Friday, 17 June 2016

Change the display name of enums

In c# you can change the display name of enums. For this we can use Display attribute with properties.


 public enum Roles
        {
            [Display(Name = "Super Admin")]
            SuperAdmin = 1
            [Display(Name = "Site Admin")]
            SiteAdmin = 1
        };

No comments:

Post a Comment