using Marco.Pms.DataAccess.Data; using Marco.Pms.Model.Projects; using Microsoft.CodeAnalysis; using Microsoft.EntityFrameworkCore; namespace MarcoBMS.Services.Helpers { public class ProjectHelper { private readonly ApplicationDbContext _context; public ProjectHelper(ApplicationDbContext context) { _context = context; } public async Task> GetTeamByProject(int TenantId, int ProjectId, bool IncludeInactive) { if (IncludeInactive) { var employees = await _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == ProjectId).Include(e => e.Employee).ToListAsync(); return employees; } else { var employees = await _context.ProjectAllocations.Where(c => c.TenantId == TenantId && c.ProjectId == ProjectId && c.IsActive == true).Include(e => e.Employee).ToListAsync(); return employees; } } } }