Duplicate LINQ to SQL entity / record?
- by GONeale
Hi guys,
What would be considered the best practice in duplicating [cloning] a LINQ to SQL entity resulting in a new record in the database?
The context is that I wish to make a duplicate function for records in a grid of an admin. website and after trying a few things and the obvious, read data, alter ID=0, change name, submitChanges(), and hitting an exception, lol. I thought I might stop and ask an expert.
I wish to start with first reading the record, altering the name by prefixing with "Copy Of " and then saving as a new record.