Skip to content

Instantly share code, notes, and snippets.

@tomorgan
Created July 29, 2014 12:40
Show Gist options
  • Save tomorgan/f76bdfd3d01b49180b68 to your computer and use it in GitHub Desktop.
Save tomorgan/f76bdfd3d01b49180b68 to your computer and use it in GitHub Desktop.
Asynchronous Lambda Expression Example
private void MyMethod() {
//do some stuff
var flow = GetFlowFromSomewhere();
var message = GetMessageFromSomewhere();
flow.BeginSendInstantMessage(message, result =>
{
try
{
flow.EndSendInstantMessage(result)
}
catch (Exception ex)
{
//do something with this error
}
},null);
//do some other things....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment