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

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

Advertisment to support michlstechblog.info