public async Task <List <Role> > HandleAsync(GetRolesQuery query, CancellationToken cancellationToken = default) { var db = _roleRepository.Get(new RoleQueryOptions { IncludeClaims = query.IncludeClaims, IncludeUserRoles = query.IncludeUserRoles, AsNoTracking = query.AsNoTracking, }); return(await _roleRepository.ToListAsync(db)); }
public List <Role> Handle(GetRolesQuery query) { var db = _roleRepository.Get(new RoleQueryOptions { IncludeClaims = query.IncludeClaims, IncludeUserRoles = query.IncludeUserRoles, AsNoTracking = query.AsNoTracking, }); return(db.ToList()); }