Created
May 1, 2019 19:38
-
-
Save maiconcp/cf3c584dc49ee507253bccae12fce84c to your computer and use it in GitHub Desktop.
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 class Client | |
{ | |
private readonly ProductService _productService; | |
public Client() | |
{ | |
_productService = new ProductService(); | |
} | |
private string Call() | |
{ | |
try | |
{ | |
return _productService.GetSample().Result; | |
} | |
catch (AggregateException ex) | |
{ | |
return ex.InnerException.GetType().FullName; | |
} | |
} | |
public void Test_5_Calls() | |
{ | |
for (int i = 1; i <= 5; i++) | |
{ | |
Console.WriteLine($"Call {i}: {Call()}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment