public Role Handle(RoleByName query) { if (query == null) { throw new ArgumentNullException("query"); } var internalQuery = new RolesUnfiltered(query.Principal) { EagerLoad = query.EagerLoad, }; var internalQueryable = _queryProcessor.Execute(internalQuery); return(internalQueryable .SingleOrDefault(x => query.Name.Equals(x.Name, StringComparison.OrdinalIgnoreCase)) ); }
public Role Handle(RoleById query) { if (query == null) { throw new ArgumentNullException("query"); } var internalQuery = new RolesUnfiltered(query.Principal) { EagerLoad = query.EagerLoad, }; var internalQueryable = _queryProcessor.Execute(internalQuery); return(internalQueryable .SingleOrDefault(x => x.RevisionId == query.Id) ); }
public Role[] Handle(RolesGrantedToUserId query) { if (query == null) { throw new ArgumentNullException("query"); } var internalQuery = new RolesUnfiltered(query.Principal) { EagerLoad = query.EagerLoad, OrderBy = query.OrderBy, }; var internalQueryable = _queryProcessor.Execute(internalQuery); return(internalQueryable .Where(x => x.Grants.Any(y => y.User.RevisionId == query.UserId)) .ToArray() ); }
public Role[] Handle(RolesGrantedToUserName query) { if (query == null) { throw new ArgumentNullException("query"); } var internalQuery = new RolesUnfiltered(query.Principal) { EagerLoad = query.EagerLoad, OrderBy = query.OrderBy, }; var internalQueryable = _queryProcessor.Execute(internalQuery); return(internalQueryable .Where(x => x.Grants.Any(y => y.User.Name.Equals(query.UserName, StringComparison.OrdinalIgnoreCase))) .ToArray() ); }