예제 #1
0
        public async Task <object> Convert([FromBody] ConvertModel model)
        {
            var body = await Request.BodyAsStringAsync();


            if (model == null)
            {
                Console.WriteLine("Convert: !!!! Model is null !!!!!; Body: " + body);
                return(NotFound());
            }

            Console.WriteLine("Convert:" + model.ToJson() + "; Body: " + body);

            model.From = model.From.Trim();
            model.To   = model.To.Trim();

            var amount = await _rateConverterSrv.ConvertAsync(model.From, model.To, model.Amount);

            return(new { asset = model.To, amount });
        }