示例#1
0
        private async Task AddModuleElement(List <ModuleElementRequestDto> moduleElementRequestDtos)
        {
            var elements = moduleElementRequestDtos.Where(m => m.OperationStatus == OperationModel.Create).ToList();

            if (elements.Any())
            {
                await _moduleElementAppService.BatchCreateAsync(elements);
            }
        }
示例#2
0
        /// <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);
        }