Inside a method i make a few web service calls to get data, like so:
public void SomeMethod()
{
var user = userWS.GetUsers();
var documents = documentWS.GetDocuments();
}
I also have an XML file in which a user can tell what property to map. The XML sort of looks like this:
<root>
<item id="username" mapper="user.username.value" />
<item id="document1" mapper="documents.document1.value" />
</root>
So what i basically want to do is execute to string that is inside the mapper
attribute. So that i have something like this:
public void SomeMethod()
{
var user = userWS.GetUsers();
var documents = documentWS.GetDocuments();
// returns: "user.username.value"
string usernameProperty = GetMapperValueById ( "username" );
var value = Invoke(usernameProperty);
}
So it should act as if i was calling var value = user.username.value;
manually in my code.
But how can i invoke this action from a string
?