I have a http request coming that has a property for a value. There are 2 possible options for this value, let's say Standard and Boosted. I'm using an enum for this.
I also need to get the same value from my database, but in database this value is called something else. For example they are called TypeS and TypeB.
I'm looking for an easy way to map them to each other.
I've tried using an Alias but that doesn't seem to be working.
pubic enum RequestType
{
[Alias("TypeS")]
Standard,
[Alias("TypeB")]
Boosted
}
public class ReturnObject
{
public RequestType type {get; set;}
}
I'm getting the record from the database using a stored proc.
db.SqlList<ReturnObject>("EXEC SomeStoredProc @someParameter",
new { someParameter }).ToList();
ReturnObject.type is always Standard even tho the Database returns TypeB which tells me it instantiates the enum with the default value.