public void ExecuteConversion(string value) { CurrencyToConvertModel currencyToConvertModel = ConvertCommandHelper.MapToDataAccessModel(value); var response = _conversionService.ConvertToText(currencyToConvertModel); ConverstionOutput = response.Result.WordsValue; }
public async Task <ConvertedValueModel> ConvertToTextAsync(CurrencyToConvertModel currencyToConvertModel) { ConvertedValueModel convertedCurrencyValue = null; HttpResponseMessage response = await _apiClient.PostAsJsonAsync( "api/currency-to-words", currencyToConvertModel).ConfigureAwait(false); response.EnsureSuccessStatusCode(); if (response.IsSuccessStatusCode) { convertedCurrencyValue = await response.Content.ReadAsAsync <ConvertedValueModel>(); } return(convertedCurrencyValue); }
public async Task <ConvertedValueModel> ConvertToText(CurrencyToConvertModel currencyToConvertModel) { return(await ConvertToTextAsync(currencyToConvertModel).ConfigureAwait(false)); }