I would like to know if it is possible to do something like this:
class brand
{
string name;
}
class car
{
string carname;
brand carbrand;
}
now I have such a line and an instance of an object such as a car:
car carobject = new car();
string brandNameOfCar = DoSomeMagicalReflectionStuff(car, "car.brand.name");
What does the DoSomeMagicalReflectionStuff method look like?
And it’s even possible to do something like:
car carobject = new car();
string brandNameOfCar = DoSomeMagicalReflectionStuff(car, "car.brand.name.ToFormatedString()");
Thanks!
David
source
share