Beispiel #1
0
        public IdentityRole FindById(int roleId)
        {
            var constraints = new QueryConstraints <IdentityRole>()
                              .Where(x => x.Id == roleId);

            return(queryRepository.SingleOrDefault(constraints));
        }
Beispiel #2
0
        public Task <User> FindByIdAsync(int userId)
        {
            if (userId == 0)
            {
                throw new ArgumentNullException("userID", "must not be null.");
            }

            var constraints = new QueryConstraints <User>()
                              .IncludePath(u => u.Roles)
                              .Where(x => x.Id == userId);

            return(Task.FromResult(queryRepository.SingleOrDefault(constraints)));
        }