Compare commits

...

4 Commits

View File

@ -76,14 +76,13 @@ namespace MarcoBMS.Services.Helpers
try
{
List<EmployeeVM> result = new List<EmployeeVM>();
if (ProjectId != null)
if (ProjectId.HasValue)
{
result = await (from pa in _context.ProjectAllocations.Where(c => c.ProjectId == ProjectId)
join em in _context.Employees.Where(c => c.TenantId == TenentId && c.IsActive == true).Include(fp => fp.JobRole) // Include Feature
on pa.EmployeeId equals em.Id
select em.ToEmployeeVMFromEmployee()
)
result = await _context.ProjectAllocations
.Include(pa => pa.Employee)
.Where(c => c.ProjectId == ProjectId.Value && c.IsActive && c.Employee != null)
.Select(pa => pa.Employee!.ToEmployeeVMFromEmployee())
.ToListAsync();
}