5
I’m having a hard time in a project. I created two tables (Union and Schoolhouse), whereas the PK table Union is FK on the table Schoolhouse. But this FK may be void, i.e., the Schoolhouse may belong to a Union or not. Well, here’s my problem. I managed the mapping in the Entity Framework and when trying to insert a School without a linked Union, it gives the following error:

Here you have a problem just like yours. http://stackoverflow.com/questions/5668801/entity-framework-code-first-null-foreign-key
– Marconi