private static async Task <PriceHumanizerResponse> CallHumanizePriceAsync(string price) { IPriceHumanizerService service = new PriceHumanizerServiceClient(); var priceHumanizerRequest = new PriceHumanizerRequest(); priceHumanizerRequest.price = price; return(await Task.Factory.FromAsync(service.BeginHumanizePrice, HumanizePriceEnded, priceHumanizerRequest, service)); }
public PriceHumanizerResponse HumanizePrice(PriceHumanizerRequest request) { IIntergerHumanizer _integerHumanaizer = new IntegerHumanizer(); IReadableBuilder _currencyBuilder = new CurrencyReadableBuilder(_integerHumanaizer); var priceHuminizer = new CurrencyHumanizer(_currencyBuilder, new CurrencyFormatParser()); var resp = priceHuminizer.Humanize(request.price); return(new PriceHumanizerResponse { humanizedPrice = resp }); }