linq to sql - How can I clone (or copy) a object to another one, but don't copy PK attribute? -


I'm trying to copy all object attributes to another object, FOX example:

  person p1 = new person (); P1.name = "John"; P1.sex = 'M'; Person p2 = new person (); P2 = Utill. Clone (p1);  

The problem is that the person unit has an identity PK 'codprison' and I do not want to copy this PK. Is there a way to clone / copy an object, but it does not have a copy of its PK attribute ??

Thank you!

  1. Make sure that Util.Clone (person p) codeproduction attribute
  2. Clear the attribute after the clone method
  3. Create a new person object, especially starting the special properties.

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -