public ActionResult <CurrencyRateDTO> Add([FromBody] CurrencyRateDTO currencyRateDTO) { if (_srv.GetByCurrencyIds(currencyRateDTO.BaseCurrencyId, currencyRateDTO.TargetCurrencyId) != null) { throw new ApplicationException("Currency Pair rate already exists"); } var addedCurrencyRate = _srv.Add(currencyRateDTO); _unitOfWork.Commit(); return(CreatedAtAction(nameof(GetById), new { id = addedCurrencyRate.Id }, _srv.MapToDTO(addedCurrencyRate))); }