In the database I often store enum values as smallint and then perform an Enum.Parse when I pull them out to cast the int values into the enumeration structures I have already created. I see in the designer that the .NET type is set to System.Int16 automatically and I am wondering if there is any way I can force the type to actually bind to my enumeration and not the System.Int16 type.
As an example I have the idea of statuses that are defined in C# as follows:
public enum PackageStatus {
Active = 0,
Inactive = 1,
Pending = 2,
ScheduledForInitialization = 3
}
In the database this is stored in the Package entity as status smallint NOT NULL.
The designer is defining the Package entity in C# as System.Int16 Status. I would like the definition to actually be PackageStatus Status.
Thanks...