public async Task <Role> GetRoleLoadRelatedAsync(string roleName) { var role = await AllAsQueryable.Include(r => r.Claims) .Include(r => r.Users) .Where(r => r.Name == roleName) .FirstOrDefaultAsync(); return(role); }
public async Task <User> GetUserByIdAsync(int userId) { var user = await AllAsQueryable .Include(u => u.Roles) .FirstOrDefaultAsync(u => u.Id == userId); if (user == null) { return(null); } return(user); }