From 4420912917629a3a77b10661bc94cc948b6ac5da Mon Sep 17 00:00:00 2001 From: Vzart Date: Wed, 12 Jul 2023 15:21:07 +0700 Subject: [PATCH] fix: get all users include department --- src/Application/Users/Queries/GetAllUsersPaginated.cs | 2 ++ 1 file changed, 2 insertions(+) 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