c# - Converting strings in to an expression trees? -


We need to provide a user friendly description for types. We have created a resource file that maps to a description type Does.

The complete name of the example is used as the key with the substituted points with the underscore, the description is a string and includes templates that refer to the property in the example.

When we get an example, we get its type, get the key, and use it to find the resource value. Then use regex to remove those template properties then use the reflection to actually get the value of the property

For example the example may be that the main name MyNameSpace_MyPublicTypes_Address The name (the full name is' My namespace. Myspace type 'address')

The description may be in' user {state.City} in {country} '- state and country are properties on the address class I assume a property in the state Is.

Is there anything like 'obj => obj.State.City' or 'obj => obj.Country'? Or some kind of expression?

I am using obj because it is the illustrated example

Any help appreciated. Not sure that this question has been asked before.

This is a very dynamic LINQ library, one of .NET 3.5 samples). Source, or for use, you should be able to detect the code that parses the string in expression s Of course, dividing on is not difficult. and manually gathering it; I have a dynamic orderbie implementation that does this.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -