Created
November 30, 2011 19:46
-
-
Save howarddierking/1410489 to your computer and use it in GitHub Desktop.
WCF 4.5 Async Service Operation
This file contains 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 async Task<double> CalculateShippingSubtotalAsync(int productID, string postalCode) | |
{ | |
var productServiceProxy = new ProductServiceClient(); | |
var shippingServiceProxy = new ShippingServiceClient(); | |
var t = productServiceProxy.GetProductByIDAsync(productID); | |
var t2 = shippingServiceProxy.GetShippingCostForPostalCodeAsync(postalCode); | |
await Task.WhenAll(t, t2); | |
return t.Result.UnitPrice + t2.Result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment