0

I'm new to C# and working on existing project. I found this clone in all the Data classes, can someone tell me why is it necessary to do this? Any known issues if i don't use clone? Thanks in advance!

public class PreviewRequestDetails : ICloneable
    {

    [DataMember]
    public string Address { get; set; }

    ........


     public object Clone()
        {
            return new PreviewRequestDetails
            {
                Address = this.Address,
                Email = this.Email,
                Id = this.Id,
                Country = this.Country,
                Phone = this.Phone,
                Titles = this.Titles.Select(p => p.Clone() as Title).ToList(),
                CreatedBy = this.CreatedBy,
                CreatedOn = this.CreatedOn,
                UpdatedOn = this.UpdatedOn,
                Delete = this.Delete
            };
        }
}
madreflection
  • 4,744
  • 3
  • 19
  • 29
Wreeecks
  • 2,186
  • 1
  • 33
  • 53

0 Answers0