I\'m creating a child object from a parent object. So the scenario is that I have an object and a child object which adds a distance property for scenarios where I want to s
You can use reflection to copy properties.
public class ChildClass : ParentClass { public ChildClass(ParentClass ch) { foreach (var prop in ch.GetType().GetProperties()) { this.GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(ch, null), null); } } }