Created
April 20, 2010 15:50
-
-
Save jfromaniello/372660 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IFoo MyMethod(IBar bar, IBaz baz) | |
{ | |
//My sync code | |
} | |
public IFoo MyMethodAsync(IBar bar, IBaz baz) | |
{ | |
Func<IFoo, IBar, IBaz> func = MyMethod; | |
return func.ToAsync()(bar, baz); | |
} | |
//Usage; | |
MyMethodAsync(barValue, bazValue) | |
.Subscribe(fooResult=> Console.WriteLine(fooResult)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment