Question

We're adding some views to our entity framework model. Some fields in these views are nullable datetime2 datatypes in our sql server 2k8 db and the edmx is incorrectly showing these fields as being not null. Is this a known issue?

When I try to change them to not null it still throws the same error - because it appears as if the ssdl is defining it differently?

Has anyone run into this problem?

Edit: My exact error is:

The 'dateTimeAffected' property on 'V_myView' could not be set to a 'null' value. You must set this property to a non-null value of type 'DateTime'

Removing the view and adding it back in does not fix it as well... still marks the field as not nullable.

Was it helpful?

Solution

Sorry for this silly answer but you did delete the tables and add them again...for some reason ef4 does not refresh them properly...but ya not a known problem with ef4 it should show them as nullable...btw what error are you getting?

OTHER TIPS

you said the property is marked as a key, but by its name it doesnt sound like this is the case. (having it marked as key of course dosent sit well with nullablility...) do you have a PK defined ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top