private async Task AddModuleElement(List <ModuleElementRequestDto> moduleElementRequestDtos) { var elements = moduleElementRequestDtos.Where(m => m.OperationStatus == OperationModel.Create).ToList(); if (elements.Any()) { await _moduleElementAppService.BatchCreateAsync(elements); } }
/// <summary> /// 批量新增 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <JsonResponse> BatchCreate(ModuleElementBatchRequestDto input) { foreach (var moduleElementRequestDto in input.ModuleElementRequestList) { moduleElementRequestDto.InitCreateRequest(input.Payload); } var resJson = await _applicationEnginee.TryTransactionAsync(async() => { await _moduleElementAppService.BatchCreateAsync(input.ModuleElementRequestList); }); return(resJson); }