error 2016: Condition cannot be specified for Column member
Posted
by IP
on Stack Overflow
See other posts from Stack Overflow
or by IP
Published on 2010-03-16T22:30:35Z
Indexed on
2010/03/17
23:21 UTC
Read the original article
Hit count: 357
entity-framework
|VS2010
I am having some issues with Entity Framework in VS2010
The problem I'm getting is described very well here...
http://social.msdn.microsoft.com/Forums/en/adonetefx/thread/cacf6a76-09a8-4c90-9502-d8b87c2f6bea
It's basically happening when a Foreign key is pointed at the primary key of another table...but if I take off the StoreGeneratedPattern as "Identity", then it tries to insert a value into the identity field
** EDIT So, what it seems to be is that EF4 can't handle a null relationship when the primary key is set to StoreGeneratedPattern="Identity". If I create a FK pointing to this primary key, and make it nullable (effectively creating a 0...M relationship), then it throws this compilation error.
Removing StoreGeneratedPattern="Identity" fixes the issue, but causes issues elseware It works if the foreign key is set to not nullable
© Stack Overflow or respective owner