Open YoussefMorad1 opened 8 months ago
I'm Not sure what's the use [EnumMember(Value = "Full Time")]
and if it would actually auto serialize into the written EnumMember? or it will use the standard .ToStirng()
written in the fluent api? and if no .ToString()
is written what would it serialize to?
I'll make sure to update here after I get my answers when I try with the Create View.
[EnumMember(Value = "Full Time")]
that WAS written in the original issue wasn't useful since you're already using .ToString()
in your fluent api..ToString()
written in fluent api.ToString()
is written in fluent api, it would convert the enum into Integer
and won't also use the EnumMember
thing.After reading your answers,
Now another question would be, what is the usage of EnumMember
attribute? and do I need to use it? and is it useful to the problem we're facing in this issue?
So I'd like to save the
EmployeeType
in the DataBase as "Part Time", "Full Time". But NOT "PartTime", "FullTime". How to handle this in Serializing & Deserializing?I'm asking about a more automated way or some library or annotation more than just writing my
CustomParse()
in fluent api to convert the string into Enum. So I'd like to avoid conditions in serialize/deserialize.Here is also the current fluent api conversion (that converts from/to "PartTime"/"FullTime"):