Open picolino opened 5 years ago
Think this method is a place that must be modified for fix this behaviour.
Activator.CreateInstance (map.MappedType);
For fix require to retrieve default value from DefaultValueAttribute
and then replace value of instance property by retrieved value from attribute.
Database:
Data:
C# code model:
Business logic:
So the problem is
null
value in database realised asdefault(int)
- zero (0) value in code. I expecting that default value will be as i mentioned in database model in c# code (-1).p.s. I understand that better to use
Nullable<int>
type forSecondId
property, but I also think that not applying default value defined in model makes little inconsistent behaviour.