I Have the following function:
protected static T WrapException<T>(Func<T> function)
{
T result = default(T);
WrapException(delegate
{
result = function();
});
return result;
}
I use this function in all of my WCF Project services endpoint:
public List<ResultDTO> GetSomething(SessionDto sessionDto)
{
return WrapException(() => _someFacade.Get(sessionDto));
}
what i need is to change the value of sessionDto at WrapException before the action is called.
I tried to access it by making the following cast:
((dynamic)function.Target)
it works fine, but when i try to access the arguments, it throws an exception.
What am i doing wrong?
Obs: sorry by my english, not my native language