C# how to create a method that invokes a delegate to another generic method -
i have code this....
var x = inv.invokeproxy<serviceclient, anothertype, returntype>( p => p.execute(input), guid);
what looking encapsulate of above code delegate including specified types.
i want create method literally invoke above method. this...
func<a,b> func = delegate() { .... 1st code sample inserted here ... }
then need pass func method invoke e.g.
protected treturn invokedelegate<treturn>(func<> functionobject) { return functionobject.invoke(); }
does know how can done?
this pretty simple:
func<typeofinput, guid, typeofx> func = (input, guid) => inv.invokeproxy<serviceclient, anothertype, returntype>( p => p.execute(input), guid);
execute this:
typeofinput yourinput = ...; guid yourguid = ...; typeofx x = func(yourinput, yourguid);
Comments
Post a Comment