I am working on a database first environment where there is a specific requirement.
Back to start when there was no value to fill the default value would be a string of x cardinality empty spaces.
However when using ef with becomes kinf of odd because NotNull/Required treats empty spaces as a null value.
I needed being able to add on dbcontext the required attribute for this specific properties as
Code: Select all
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
thanks