public List <PolicyHolderViewModel> get_PH_ByPackage(int pack) { using (var phr = new PolicyHolderRepository()) { return(phr.GetAll().Where(q => q.packageID == pack).Select(x => new PolicyHolderViewModel() { policyNo = x.policyNo, IDNumber = x.IDNumber, title = x.title, firstName = x.firstName, lastName = x.lastName, dateStarted = x.dateStarted, status = x.status }).ToList()); } }
public List <PolicyHolderViewModel> get_PH_ByGender(string gender) { using (var phr = new PolicyHolderRepository()) { return(phr.GetAll().Where(q => getGender(q.IDNumber) == gender).Select(x => new PolicyHolderViewModel() { policyNo = x.policyNo, IDNumber = x.IDNumber, title = x.title, firstName = x.firstName, lastName = x.lastName, dateStarted = x.dateStarted, status = x.status }).ToList()); } }