jeudi 20 octobre 2016

How to decorate enum wiht attribute in c#

I have an enum on helper library in my solution. For example

public enum MyEnum 
{  
 First,
  Second 
 }

I want to use MyEnum in a few another project. I want to decorate this enum in each project with own attribute like this:

public enum MyEnum 
 { 
 [MyAttribute(param)] 
 First,
 [MyAttribute(param2)]
 Second 
}

How to decorate enum from another library with own local attribute?

Aucun commentaire:

Enregistrer un commentaire