C# - Recursive / Reflection Property Values
Posted
by tyndall
on Stack Overflow
See other posts from Stack Overflow
or by tyndall
Published on 2010-04-22T16:51:53Z
Indexed on
2010/04/22
16:53 UTC
Read the original article
Hit count: 827
What is the best way to go about this in C#?
string propPath = "ShippingInfo.Address.Street";
I'll have a property path like the one above read from a mapping file. I need to be able to ask the Order object what the value of the code below will be.
this.ShippingInfo.Address.Street
Balancing performance with elegance. All object graph relationships should be one-to-one. Part 2: how hard would it be to add in the capability for it to grab the first one if its a List<> or something like it.
© Stack Overflow or respective owner