public async Task UpdateAsync([FromBody] AssetHedgeSettingsEditModel model) { try { AssetHedgeSettings assetHedgeSettings = Mapper.Map <AssetHedgeSettings>(model); await _assetHedgeSettingsService.UpdateAsync(assetHedgeSettings); } catch (EntityNotFoundException) { throw new ValidationApiException(HttpStatusCode.NotFound, "The asset hedge settings does not exist"); } }
public async Task AddAsync([FromBody] AssetHedgeSettingsEditModel model) { try { AssetHedgeSettings assetHedgeSettings = Mapper.Map <AssetHedgeSettings>(model); await _assetHedgeSettingsService.AddAsync(assetHedgeSettings); } catch (EntityAlreadyExistsException) { throw new ValidationApiException(HttpStatusCode.Conflict, "The asset hedge settings already exists"); } }