Пример #1
0
            public async Task <object> Handle(
                Query message,
                CancellationToken cancellationToken)
            {
                var role = await _dbContext.Roles.AsNoTracking()
                           .SingleAsync(
                    x => x.Id == message.ResourceParams.Id,
                    cancellationToken);

                var roleDto = new RoleDto(
                    role.Id,
                    role.Name,
                    string.Join(
                        ", ",
                        role.PermissionsInRole));

                return(roleDto.ShapeData(message.ResourceParams.Fields));
            }