Here is the code I would like to use:
public enum Days { Sat = 1, Sun, Mon, Tue, Wed, Thu, Fri };
[EnumHelper(typeof(Days))]
public Days DayOfWeek { get; set; }
EnumHelper looks like:
[AttributeUsage(AttributeTargets.Property,AllowMultiple=true)]
public class EnumHelper : Attribute
{
public Type MyEnum { get; set; }
public EnumHelper(Type enum)
{
MyEnum = enum;
}
}
The error I get on EnumHelper(Days) is that "Enum Name not valid at this point". Am I doing something wrong, or can this not be done?
MORE INFO
I am trying to pass the Enum (Days), and randomly get back one of the values.
NEVERMIND: I was over-complicating this part.