Self referencing foreign key - GUID - Entity framework 4 insert problems -
I have successfully used EF4 to insert lines with a built-in GUID:
How does one do this work if there is a rudder (guide) and parentone with a primary-foreign key barrier between the two? What can I set?
Nuke = {.ParentRowID = .RowID} with new line
The Save Change throws a fit at all times.
The fact is that the primary key is a GUID really irrelevant because I tried the same test using a standard autogenerated integer without success.
The solution is as easy as you have posted.
Make both parents and children in the bus code, do not set the unit key and do not forget to set StoreGeneratedPattern for all server-generated good columns.
Then either masters institute. Child. (Addition of Child Endachine), or Child Stability: Instance.mastersInstitute = Muscularity Instance and Call Change Change.
After calling SaveChanges, both grid properties are populated with correct grid values, and ChildEntity.MasterEntity unit key. The MasterEntity unit will be populated with the key value.
Comments
Post a Comment