Skip to content

Instantly share code, notes, and snippets.

@jfromaniello
Created April 20, 2010 15:50
Show Gist options
  • Save jfromaniello/372660 to your computer and use it in GitHub Desktop.
Save jfromaniello/372660 to your computer and use it in GitHub Desktop.
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