Just call the static method FastClone.Clone:
Customer c = new Customer
{
Id = Guid.NewGuid(),
Name = "Frank",
Age = 31,
Married = true
};
Customer c2 = (Customer)FastClone.Clone(c, "Id");
Optionally properties can be given to exclude from the clone.
You can download the source of FastClone here.
Enjoy!
No comments:
Post a Comment