9 Temmuz 2012 Pazartesi

LINQ error: Null value for non-nullable member.

When i tried to save an object with a complex type (with a null instance of the complex type), i got the following error:

{"Null value for non-nullable member. Member: 'Sentence'."}

In this link there is an explanation for this: http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/50d33271-c8e3-468f-82e1-7c3178cb4322/
According to the explanation, complex types are always considered as required in entity framework. My workaround is creating an instance of the complex type with new keyword in the constructor.

Hiç yorum yok:

Yorum Gönder