In this article we see How to Fix the Entity Framework error "Problem in mapping fragments" : "Non-nullable column is mapped to a nullable entity property" :
How to Fix the Entity Framework error "Problem in mapping fragments"
This Entity Framework error is originated when your Data Model contains an Entity with a nullable property , while at the Data Store, the mapped column has been defined as non-nullable.
Let's see the Error Message : some "Non-nullable column" has been mapped to a "nullable entity property" , therefore let's locate at the Model (not at the "Store") that property : in our case, is the property "name" :
We find there that the Entity Model property mapped to the non-nullable column , has not set the "Nullable" field.
Now we open the "Details" window to take a look at the property :
So set it in the way that conforms to the Store's column definition:
After that, you can "validate" the Entity Data Model by right clicking on the property :
In this case, because there is only one property wrongly mapped, the Data Model is validated with no errors:
By Carmel Shvartzman
עריכה: כרמל שוורצמן
No comments:
Post a Comment