private async void AnalyseQuote(string quote) { ErrorText = ""; try { var result = await quotesApiClient.ValidateSingleQuote(quote, ConfigurationManager.AppSettings["QuoteValidatorApiUrl"]); Polarity = result.result.polarity; Type = result.result.type; } catch (Exception e) { ErrorText = "Connection error. Try again later."; } }
private async Task <Tuple <string, ValidatedQuote> > getValidationResult(string quote) { IQuotesApiClient apiClient = container.Resolve <IQuotesApiClient>(); Tuple <string, ValidatedQuote> result = new Tuple <string, ValidatedQuote>(quote, await apiClient.ValidateSingleQuote(quote, ConfigurationManager.AppSettings["QuoteValidatorApiUrl"])); return(result); }