Moving Beyond Enums
I just published an article on ASPAlliance on Moving Beyond Enums, describing when and how to move from enums to classes in your code when you start demanding more from your enums than they were designed to give. Check it out and let me know what you think. I also thought I’d post an alternate LINQ-ified version of the DisplayFriendlyNames() method I used in the article. Original, non-LINQ version: public static string DisplayFriendlyNames() { var sb = new StringBuilder(); foreach (Role role in Role.List()) { if (role.IsVisible) { sb.AppendLine(role.Name); } } … more