Framework for Entities A nullable entity property is mapped to a non-nullable column.

c# entity-framework mapping nullable poco

Question

I am getting this nullable column error message in Entity Framework 4.1 - when the column is not actually nullable:

Non-nullable column MyView.RunningTotal in table TransactionListView 
is mapped to a nullable entity property.

But you can see from the screenshots below that the column is not nullable and that the entity property is not nullable either. So why is this error occurring?

enter image description here

1
8
4/10/2012 1:54:29 AM

Accepted Answer

The straight-forward solution is to manually specify Nullable parameter to True.

12
4/13/2012 1:10:55 PM

Popular Answer

2017 Update (Visual Studio 2017)

If the accepted straight-forward solution mentioned by lLya didn't help you, then this might. You may notice that when you save a diagram it does some work, like changing the class properties according to your diagram changes. One would think that the generator itself would be aware of these changes, right?! You might still get this error.

What fixed it for me was regenerating the database (right click in diagram -> Regenerate Database from Model).



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow