Пример #1
0
        public async Task <GetOperationOutput> GetOperation(long id)
        {
            var operation = await _operationRepository.SingleOrDefaultAsync(p => p.Id == id);

            if (operation == null)
            {
                throw new BusinessException($"不存在Id为{id}的操作信息");
            }
            var operationOutput = operation.MapTo <GetOperationOutput>();

            operationOutput.Actions = (await _actionDomainService.GetOperationOutputActions(operation.Id)).MapTo <IEnumerable <GetActionOutput> >();
            return(operationOutput);
        }
Пример #2
0
        public async Task <GetOperationOutput> GetOperation(long permissionId)
        {
            var operation = await _operationRepository.SingleOrDefaultAsync(p => p.PermissionId == permissionId);

            if (operation == null)
            {
                throw new BusinessException($"不存在permissionId为{permissionId}的操作信息");
            }
            var operationOutput = operation.MapTo <GetOperationOutput>();

            operationOutput.ActionIds = (await _actionDomainService.GetOperationOutputActions(operation.Id)).Select(p => p.Id);
            return(operationOutput);
        }