This question is locked. New answers and comments are not allowed.
Dear Team,
i am encountering a scenario that is as follows.
i have two tables named parent and child.
Upon fetching data from database, i got 1 row against parent and 2 rows against child.
At this stage if i create new child and add it to context and apply save changes, so now my database contains 1 row against parent and 3 rows against child but my context only contains 2 rows against child...
Do i need to refresh whole context or only that child to get latest database childs record in context so that i can do other operations with newly added child during the entire operation.
Parent objparent = context.Parent( p => p.id = 4);
objparent.count();
//1
objparent.Child.count();
//2
Child objchild =
new
Child();
objchild.name =
"abc"
;
objchild.parentid = 4;
context.add(objchild);
context.savechanges();
//do i need to refresh whole context to have newly added child under given parent
//or i should only fetch all childs against parent id 4 and re-attach them to context