Methods for deep cloning objects in C#
Posted
by Anry
on Stack Overflow
See other posts from Stack Overflow
or by Anry
Published on 2010-04-06T14:37:46Z
Indexed on
2010/04/06
14:43 UTC
Read the original article
Hit count: 759
I have a class:
public class Order : BaseEPharmObject
{
public Order()
{
}
public virtual Guid Id { get; set; }
public virtual DateTime Created { get; set; }
public virtual DateTime? Closed { get; set; }
public virtual OrderResult OrderResult { get; set; }
public virtual decimal Balance { get; set; }
public virtual Customer Customer { get; set; }
public virtual Shift Shift { get; set; }
public virtual Order LinkedOrder { get; set; }
public virtual User CreatedBy { get; set; }
public virtual decimal TotalPayable { get; set; }
public virtual IList<Transaction> Transactions { get; set; }
public virtual IList<Payment> Payments { get; set; }
}
I need to clone objects of class Order. How to implement a deep copy right in the base class?
© Stack Overflow or respective owner