//DeepCopy public void DeepCopy(CustomerOrder from) { CustomerID = from.CustomerID ; Rating = from.Rating ; AddressInfo.DeepCopy(from.AddressInfo) ; Orders.AddRange(from.Orders) ; }
//IClonable Override public virtual object Clone() { CustomerOrder instance = new CustomerOrder() ; instance.CustomerID = CustomerID ; instance.Rating = Rating ; instance.AddressInfo = (Address)AddressInfo.Clone() ; instance.Orders.AddRange(Orders) ; return instance; }