I am retrieving an entity from the database with some proprieties.
One of the proprieties is not allowed to be not null string in the database. Even though is not null it can be an empty string ""
.
In the EF mappings the propriety is validated like:
this.Property(t => t.ColumnName)
.IsRequired()
.HasMaxLength(50);
The problem is that when I am trying to save the changes with Breeze it returns an error for the elements that have the propriety ColumnName
equal to an empty string.(saying "ColumnName is required"
).
Is this accepted behaviour? Shouldn't the error be thrown only if the the ColumnName
would be null
or undefined
?
The error Breezejs throws:
valError: Error
entityErrors: Array[5]
0: Object
entity: Object
ColumnName: function dependentObservable() {
__ko_proto__: function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) {
_latestValue: ""
_subscriptions: Object
...
...
entityAspect: ctor
__proto__: Object
errorMessage: "'ColumnName' is required"
errorName: "required"
isServerError: false
propertyName: "ColumnName"
__proto__: Object