Ejemplo n.º 1
0
 public static void Execute <T>(string endpoint, Action <T> action)
 {
     string result = WcfHelper.Execute <string, T>(endpoint, proxy => {
         action(proxy);
         return("done");
     });
 }
Ejemplo n.º 2
0
 private static void TestQuotes()
 {
     WcfHelper.Execute <IQuotes>(UNSECURE_HTTP_QUOTES_ENDPOINT, (proxy) =>
     {
         foreach (var stock in proxy.FindAllStockSymbols())
         {
             try
             {
                 Quote quote = proxy.FindCurrentQuote(stock);
                 Console.WriteLine($"stock '{stock}': / pricce: '{quote.Price}' / time: {quote.Time}");
             }
             catch (Exception e)
             {
                 Console.WriteLine($"Excxeption: {e}");
             }
         }
     });
 }
Ejemplo n.º 3
0
 private static void TestErrorHandling()
 {
     WcfHelper.Execute <IQuotes>(UNSECURE_HTTP_QUOTES_ENDPOINT, proxy => proxy.FindCurrentQuote("TSLA"));
 }