Tag Archives: description attribute

C#: Get description attribute from an enum value

Hi,

in this post I will show how to read a description attribute of an enum value by reflection. Let us assume we have a enum linke this

1
2
3
4
5
6
7
8
public enum MetalBands {
    [DescriptionAttribute("This is Metallica from CA")]
    Metallica,
    [DescriptionAttribute("This is Slayer from CA")]
    Slayer,
    [DescriptionAttribute("This is Overkill from NY")]
    Overkill
};

Continue reading C#: Get description attribute from an enum value