Search Results

Search found 1 results on 1 pages for 'iceheat'.

Page 1/1 | 1 

  • ASP.NET MVC Json Enum

    - by IceHeat
    public class Member { public string Name { get; set; } public Role Role { get; set; } } public enum Role { Plumber } public JsonResult GetMember() { Member member = new Member(); member.Name = "Joe the Plumber"; member.Role = Role.Plumber; return Json(member); } The Json always resolves the enum "Role" as 0,despite its value. What is the quickest way to get the string representation?

    Read the article

1