I am currently trying to make a EF system with a few relations/FKs.
After i run my "Package manager comandline" with a "fresh database" i get with seeded data Like this:
Now the question is : why is there a "Entry" Location_LocationId that has a NULL valll?
How can one get this away or shall it be there:??
If I havent provided enough data please let me know.
My system is working as i want to have it but i am desperate trying to "optimize" it and trying to get questions like this cleared out.
Try to use attribute ForeignKey.
before "LocationId" property in "Prognose" class
You can read this tutorial http://www.entityframeworktutorial.net/code-first/configure-one-to-one-relationship-in-code-first.aspx If you want to make one to one relations in EF.