예제 #1
0
        public async Task <IDictionary <int, RoleMicroSummary> > ExecuteAsync(GetRoleMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            if (EnumerableHelper.IsNullOrEmpty(query.RoleIds))
            {
                return(new Dictionary <int, RoleMicroSummary>());
            }

            var roleDetails = await _internalRoleRepository.GetByIdRangeAsync(query.RoleIds);

            var result = roleDetails
                         .Select(d => _roleMicroSummaryMapper.Map(d.Value))
                         .ToDictionary(k => k.RoleId);

            return(result);
        }
        public IDomainRepositoryQueryContext <IDictionary <int, RoleMicroSummary> > AsMicroSummaries()
        {
            var query = new GetRoleMicroSummariesByIdRangeQuery(_roleIds);

            return(DomainRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }
예제 #3
0
 public IEnumerable <IPermissionApplication> GetPermissions(GetRoleMicroSummariesByIdRangeQuery command)
 {
     yield return(new RoleReadPermission());
 }