I would like to know if it is possible to get attributes of the enum
values and not of the enum
itself? For example, suppose I have the following <
This is how I solved it without using custom helpers or extensions with .NET core 3.1.
public enum YourEnum
{
[Display(Name = "Suryoye means Arameans")]
SURYOYE = 0,
[Display(Name = "Oromoye means Syriacs")]
OROMOYE = 1,
}
@using Enumerations
foreach (var name in Html.GetEnumSelectList(typeof(YourEnum)))
{
@name.Text
}