Best way to create instance of child object from parent object
The base class needs to define a copy constructor: public class MyObject { protected MyObject(MyObject other) { this.Prop1=other.Prop1; this.Prop2=other.Prop2; } public object Prop1 { get; set; } public object Prop2 { get; set; } } public class MyObjectSearch : MyObject { public double Distance { get; set; } public MyObjectSearch(MyObject obj) : base(obj) { this.Distance=0; … Read more