-
Type:
Task
-
Resolution: Works as Designed
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.12.3
-
Component/s: Serialization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When I use the IgnoreIfDefaultConvention, enums that starts at 0 does not save the first element of the enum. When I change the starting number to 1, it starts saving again normally. I think that when it goes to check the convention, it checks the number and mark as default because integers default is 0 in C#, and the convention make the driver ignore it, but it is wrong because it's not a default value for Enum, it has a value, it's just the underlying value that is the same as the default for integer.
Example
public enum LogType
{
Info, // Doesn't save the first element
Warning,
Error
}
public class Model()
{ public LogType Type \{ get; set; }}