I've a question and I hope this is possible. I want to map properties from an nested class into his parent class (without creating a new object, this should be the same object) Below I've attached an example.
I want to map the properties from the Bar class (which is in de Foo class) to the properties on the Bar class. So I've an instance of Foo and SomeIntProperty and SomeString property has their default value, the Bar property instead has some real values. I want to map those values from the Bar property from Foo to Foo. Is this possible, and is it possible without specifying a mapper for the properties? My classes contains a lot of properties..
I find it really hard to explain, sorry if it is still confusing.
public class Foo
{
public int SomeIntProperty { get; set; }
public string SomeStringProperty { get; set; }
// the properties from this Bar instance should be mapped to the properties above.
public Bar Bar { get; set; }
}
public class Bar
{
public int SomeIntProperty { get; set; }
public string SomeStringProperty { get; set; }
public bool ThisPropertyDoesntExistsOnFooClass { get; set; }
}