From 000cef3bb72c578863f45472734bead2e9446818 Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Fri, 10 Oct 2025 12:36:11 +0530 Subject: [PATCH] enhanced the get team based on project --- Marco.Pms.Services/Service/ProjectServices.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Marco.Pms.Services/Service/ProjectServices.cs b/Marco.Pms.Services/Service/ProjectServices.cs index 6d8c105..a3d56e0 100644 --- a/Marco.Pms.Services/Service/ProjectServices.cs +++ b/Marco.Pms.Services/Service/ProjectServices.cs @@ -2823,9 +2823,14 @@ namespace Marco.Pms.Services.Service public async Task> GetTeamByProject(Guid TenantId, Guid ProjectId, Guid? OrganizationId, bool IncludeInactive) { var projectAllocationQuery = _context.ProjectAllocations - .Include(pa => pa.Employee) - .ThenInclude(e => e!.Organization) - .Where(pa => pa.TenantId == TenantId && pa.ProjectId == ProjectId); + .Include(pa => pa.Project) + .Include(pa => pa.Employee) + .ThenInclude(e => e!.Organization) + .Include(pa => pa.Employee) + .ThenInclude(e => e!.JobRole) + .Where(pa => pa.TenantId == TenantId && + pa.ProjectId == ProjectId && pa.Project != null && + pa.Employee != null && pa.Employee.Organization != null && pa.Employee.JobRole != null); if (!IncludeInactive) { projectAllocationQuery = projectAllocationQuery.Where(pa => pa.IsActive);