Taking a snapshot (cloning) of a project using Linq 2 Sql

Posted by JoeBlogs1999 on Stack Overflow See other posts from Stack Overflow or by JoeBlogs1999
Published on 2010-04-23T00:32:02Z Indexed on 2010/04/23 0:33 UTC
Read the original article Hit count: 634

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about c#

Related posts about linq-to-sql