Exemple #1
0
        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.");
            }
        }
Exemple #2
0
        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.");
            }
        }