I have a 2 tables in database: Person
and child
.
They are hierarchy it means my child table has an Id that is PRIMARY KEY but not auto incremental.this Id fill by Id of Parent table
I have created a EDMX from these bu开发者_运维百科t when I want to save a child I can't see the fields of parent in my child class in EF it's not supported?
I want to do it like in NHIBERNATE. please help me - what should I do?
Probably you shoud just write something like
ChildInstance.Parent = ParentInstance;
By this assignment you set the necessary relationship explicitly. You don't need to assign key properties manually in EF.
精彩评论