public async Task UpdateAsync([FromBody] CrossRateInstrumentModel model) { try { var crossInstrument = Mapper.Map <CrossRateInstrument>(model); await _crossRateInstrumentService.UpdateAsync(crossInstrument); } catch (EntityNotFoundException) { throw new ValidationApiException(HttpStatusCode.NotFound, "Cross-rate instrument does not exist."); } }
public async Task AddAsync([FromBody] CrossRateInstrumentModel model) { try { var crossInstrument = Mapper.Map <CrossRateInstrument>(model); await _crossRateInstrumentService.AddAsync(crossInstrument); } catch (EntityAlreadyExistsException) { throw new ValidationApiException(HttpStatusCode.Conflict, "Cross-rate instrument already exists."); } }