You could clone the object with Automapper, modify a few of the properties and save this as a new entity.
For example:
//Get the source object from a fictitious repository
Person source = PersonRepository.GetPersonByID(555);
//Create an AutoMapper Mapper
Mapper.CreateMap<Person, Person>();
//If you want to ignore the primary key of the original object, use something like this:
//Mapper.CreateMap<Person, Person>().ForMember(x => x.PersonID, y => y.Ignore());
//Clone your source person
var clone = Mapper.Map<Person>(source);
//Set some property
clone.SomeProperty = 123;
//Save our clone against the fictional repository
PersonRepository.Save(clone);
//You could also return your clone at this point...
I used this approach the other day to clone records. One handy thing you can do is take the source identified, e.g. source.PersonID
, and store this against clone.ParentID
so you could find the origin of the clone (you can go ahead and foreign key this if you want).
Source/Suggested reading - Copy object to object (with Automapper ?)
You could also map to a new entity type if required - see the Automapper wiki - https://github.com/AutoMapper/AutoMapper/wiki/Getting-started