I have the following method:
public TResult Call<TResult>(Expression<Func<T, TResult>> code) { var returnValue = default(TResult); // code that will inspect the interface method that is being called // along with lots of other code // and then call a WebAPI service. return returnValue; } In this instance, T is an interface named ICustomer and TResult will be a class CustomerData In this specific instance, I'm doing the following:
var model = client.Call(customer => customer.Get(1)); My ultimate goal with this is to be able to inspect the interface method for certain attributes. Based on those attributes, I'd like to call a WebAPI service and pass to it any parameters that were in the interface method.
How do I figure out in the Call method that the interface.Get(1) method was called?