basically I want to create a spread of my xpath and its corresponding function name.
then set all values in one loop. I remember some gamma functionality which does exactly this, but cant find it.
hm… you should at least be able to get rid of the TryParse nodes (those are already inside the adaptive XPathGetValue). other than that, since every Set… is different i don’t see how you’d slim that down.
but typically you don’t use reflection to “clean up” your code but rather to do things that you couldn’t do otherwise, like calling functions on objects you only get to know at runtime or similar… or the number of functions to call (in your example) changes from call to call…
if it is only about cleanup, i’d not recommend using it.