コード例 #1
0
        // GET api/converter/{currencyFrom}/{currencyTo}/{amount}
        public IHttpActionResult get(string currencyFrom, string currencyTo, float amount)
        {
            if (currencyFrom == currencyTo)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var convertionRequest = CurrencyCalculator.convert(currencyFrom, currencyTo, amount);

            LogRecorder.addNewLog(convertionRequest);

            return(Ok(convertionRequest));
        }