Figured it out:
public class MyClass
{
public MyClass() { }
public MyClass(MyClass baseInstance)
{
var fields = typeof(MapObject).GetFields();
foreach (var field in fields)
field.SetValue(this, field.GetValue(baseInstance));
var props = typeof(BaseItems).GetProperties();
foreach (var prop in props)
if (prop.CanWrite)
prop.SetValue(this, prop.GetValue(baseInstance));
}
}
… lets you do this:
public static MyClass MyClass2 => new MyClass(MyClass1)
{
Property1 = 42,
Property2 = "some other text",
Property3 = new MyOtherClass(MyEnum.SomethingElse)
};
It’s not ideal but it works for me.
solved Using curly braces like in constructor to set new values to a base object