Skip to content

Instantly share code, notes, and snippets.

@larsw
Created November 5, 2010 12:03
Show Gist options
  • Save larsw/664036 to your computer and use it in GitHub Desktop.
Save larsw/664036 to your computer and use it in GitHub Desktop.
public partial class QuoteCalculatorServiceClient : System.ServiceModel.ClientBase<IQuoteCalculatorService>, IQuoteCalculatorService {
public System.Threading.Tasks.Task<ClientApp.WCFService.Quote> GetQuoteAsync(string ticker) {
return System.Threading.Tasks.Task<ClientApp.WCFService.Quote>.Factory.FromAsync(
new System.Func<string, System.AsyncCallback, object, System.IAsyncResult>((
(IQuoteCalculatorService)(this)).BeginGetQuote),
new System.Func<System.IAsyncResult, ClientApp.WCFService.Quote>(((IQuoteCalculatorService)(this)).EndGetQuote), ticker, null);
}
public System.Threading.Tasks.Task<System.Collections.ObjectModel.ReadOnlyCollection<ClientApp.WCFService.Quote>> GetQuotesAsync(string[] tickers) {
return System.Threading.Tasks.Task<System.Collections.ObjectModel.ReadOnlyCollection<ClientApp.WCFService.Quote>>.Factory.FromAsync(
new System.Func<string[], System.AsyncCallback, object, System.IAsyncResult>(((IQuoteCalculatorService)(this)).BeginGetQuotes),
new System.Func<System.IAsyncResult, System.Collections.ObjectModel.ReadOnlyCollection<ClientApp.WCFService.Quote>>(
((IQuoteCalculatorService)(this)).EndGetQuotes), tickers, null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment