private async Task CreateEngine(string assetPairId, Domain.PnLStopLossSettings pnLStopLossSettings) { PnLStopLossEngine newEngine = new PnLStopLossEngine(pnLStopLossSettings); newEngine.AssetPairId = assetPairId; newEngine.PnLStopLossSettingsId = pnLStopLossSettings.Id; await _pnLStopLossEngineService.AddAsync(newEngine); }
public async Task AddAsync([FromBody] PnLStopLossEngineModel pnLStopLossEngineModel) { try { var pnLStopLossEngine = Mapper.Map <PnLStopLossEngine>(pnLStopLossEngineModel); await _pnLStopLossEngineService.AddAsync(pnLStopLossEngine); } catch (InvalidOperationException exception) { throw new ValidationApiException(HttpStatusCode.BadRequest, exception.Message); } }