Taking a snapshot (cloning) of a project using Linq 2 Sql
- by JoeBlogs1999
I have a Project entity with several child tables, eg ProjectAwards ProjectTeamMember
I would like to copy the data from Project (and child tables) into a new Project record and update the Project status.
eg
var projectEntity = getProjectEntity(projectId);
draftProjectEntity = projectEntity
draftProjectEntity.Status = NewStatus
context.SubmitChanges();
I found this link from Marc Gravell
Its part of the way there but it updates the child records to the new draftProject, where I need it to copy.