K
kalvin.tuel
I have an enum marked with the flags attribute. I would like to
assign an alternate value to each enum member so that instead of being
stuck with the value needed for the flag I could give each member it's
position in the enum. This is just an example, what I really need is
to assign each value an ID from a database. Is there a builtin
attribute for this or do I need to create a custom attribute to handle
something like this?
What I would like:
[SYS.Flags]
private enum enumTest
{
[RealValue(1)]
First = 1,
[RealValue(2)]
Second = 2,
[RealValue(3)]
Third = 4
};
Thank you.
assign an alternate value to each enum member so that instead of being
stuck with the value needed for the flag I could give each member it's
position in the enum. This is just an example, what I really need is
to assign each value an ID from a database. Is there a builtin
attribute for this or do I need to create a custom attribute to handle
something like this?
What I would like:
[SYS.Flags]
private enum enumTest
{
[RealValue(1)]
First = 1,
[RealValue(2)]
Second = 2,
[RealValue(3)]
Third = 4
};
Thank you.