Hi All,
We have a requirement to provide user friendly descriptions for types. We have a created a resource file which maps the type to a description.
The full name of the instance with the dots replaced with underscores is used as the key. The description is a string and contains templates that refer to property in the instance.
When we get an instance, we get its type, get the key, and use it to find the resource value. Then use regex to pull out those template properties. Then use reflection to actually get the value of the property.
for eg. The instance may be Address the key would be MyNameSpace_MyPublicTypes_Address(say the full name is'MyNameSpace.MyPublicTypes.Address ')
The description can be 'User stays in {State.City} in {Country}' -- State and Country are properties on the Address class. The State has a property City.
Is it possible to have something like 'obj=>obj.State.City' or 'obj=>obj.Country' ? or some sort of expression ?
I am using obj because it is the reflected instance.
Appreciate any help. Not sure if this question has been asked before.