entity framework insert record problem
-
Hi! I have 3 tables A, B and C I am trying to insert a record in C. C has foreign key value coming from A and B. A has foreign key to B. I have access to all the data to be inserted to C except the data from B. I need the way to pull up the object of B based on foreign key id of A in B. here is the code snippet entities.AttachTo("A", C.A); entities.AttachTo("B",C.B); <-- here i can get the value of B. but it is accessible via A's Id in B. (i.e. select id from B where Aid = ID)--I need this as object. entities.AddToConfigKey(C); entities.SetLink(C, "A", C.A); entities.SetLink(C, "B",C.B); columns in C are something like this id - autoid A's Id B's Id please help
-
Hi! I have 3 tables A, B and C I am trying to insert a record in C. C has foreign key value coming from A and B. A has foreign key to B. I have access to all the data to be inserted to C except the data from B. I need the way to pull up the object of B based on foreign key id of A in B. here is the code snippet entities.AttachTo("A", C.A); entities.AttachTo("B",C.B); <-- here i can get the value of B. but it is accessible via A's Id in B. (i.e. select id from B where Aid = ID)--I need this as object. entities.AddToConfigKey(C); entities.SetLink(C, "A", C.A); entities.SetLink(C, "B",C.B); columns in C are something like this id - autoid A's Id B's Id please help
Hi there, Did you work this out? Cheers