Is there any way to assign data type to enum members; for example;
public enum CarPartEnum
{
[string]
Color,
[int]
Speed
}
Why I want to do this? Because the way it is recorded in the database, there is a CarProperties table. And there is a key-value pair in the table.
Key: Color, Value: Red; Key: Speed, Value: 250
So When I read it from database I would want to cast key to CarPartEnum and value to correct data type.