I am making c# library using dotNet5. Problem is i want to declare enum in my library that i want share across my projects via nuget package.
public enum Roles
{
[Value("Root")]
Root,
[Value("Team Member")]
TeamMember,
[Value("Team Lead")]
TeamLead
}
When i import the nuget package in another project i get following
public enum Roles
{
Root = 0,
TeamMember = 1,
TeamLead = 2,
}
Why attribute is missing when importing the nuget package ? Also is there another way to solve this issue. i am creating attribute in following way
[System.AttributeUsage(System.AttributeTargets.Field)]
public class ValueAttribute : System.Attribute
{
public ValueAttribute(string name)
{
this.Name = name;
}
public string Name { get; internal set; }
}