Logging caught an error in our application which I have been unable to reproduce. It did, however, catch the message which was:
The 'MyProperty' property on 'MyTable' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'.
Which is fine, except that the 'MyProperty' property is certainly nullable. It's set to nullable in the table.
[MyProperty] [int] NULL,
And in the EDMX file for Entity Framework, Nullable was set to (None) but the Entity itself shows the property as nullable:
public Nullable<int> MyProperty { get; set; }
Intellisense shows this as int? when creating Entities of this class.
Why is the system complaining about setting this field to null?