Suppose I have an entity called class and each class has students
Like this:
Class
|
-_______Student
How can I clone the entity class and its students?
Is the following code sufficient?
classEntity.IsNew = true;
classEntity.IsDirty = true;
foreach(var student in classEntity.Students)
{
student.IsNew = true;
student.IsDirty = true;
}
uow.Save();
I believe something like this will work with EF, but I'm not clear about LLBLGen, if the framework will traverse the object graph and update the references. ie. the new students, should now be pointing to the newly created classEntity.