diff --git a/src/Application/Users/Queries/GetAllUsersPaginated.cs b/src/Application/Users/Queries/GetAllUsersPaginated.cs index 27d57746..9fb451ad 100644 --- a/src/Application/Users/Queries/GetAllUsersPaginated.cs +++ b/src/Application/Users/Queries/GetAllUsersPaginated.cs @@ -5,6 +5,7 @@ using AutoMapper; using Domain.Entities; using MediatR; +using Microsoft.EntityFrameworkCore; namespace Application.Users.Queries; @@ -35,6 +36,7 @@ public QueryHandler(IApplicationDbContext context, IMapper mapper) public async Task> Handle(Query request, CancellationToken cancellationToken) { var users = _context.Users + .Include(x => x.Department) .Where(x => !x.Role.Equals(IdentityData.Roles.Admin)); // Filter by department