How do I return int instead of enum value?
Posted: Thu 16 May 2019 23:16
Hello,
One of my entities has a column defined as an enum. When I store the value in a database it stores as int, however when I retrieve the value EF automatically converts it into the enums string value. I would like to only return back the integer instead of the friendly name so my client application can handle casting.
Iv looked into HasConvertion however I cannot figure out how to return an int instead of the enum string value.
One of my entities has a column defined as an enum. When I store the value in a database it stores as int, however when I retrieve the value EF automatically converts it into the enums string value. I would like to only return back the integer instead of the friendly name so my client application can handle casting.
Iv looked into HasConvertion however I cannot figure out how to return an int instead of the enum string value.