samedi 27 décembre 2014

How to call this method when types are known only in runtime?

I'm having troubles invoking this method when the types are unknown at compile time.



public static IObservable<TRet> WhenAnyValue<TSender, TRet>(this TSender This, Expression<Func<TSender, TRet>> property1)


The Expression is typed and method call is also typed.


I thought of using reflection, but the code I get is really tricky and brittle. Is there a good way to "parse" this kind of calls to make them more dynamic?






Aucun commentaire:

Enregistrer un commentaire