public List <ProfileApplicationView> getApplications() { using (var ProfileAppBenRep = new ProfileApplicationBeneficiaryRepository()) { using (var ProfileAppDocRep = new ProfileApplicationDocumentsRepository()) { return(ProfileAppBenRep.GetAll().Select(x => new ProfileApplicationView() { beneficiaryID = x.beneficiaryID, benIDNumber = x.benIDNumber, IDNumber = x.IDNumber, firstName = x.firstName, lastName = x.lastName, relationship = x.relationship, age = x.age, AddOrDelete = x.AddOrDelete, reason = x.reason, documents = ProfileAppDocRep.GetAll().Select(d => new ProfileApplicationDocuments() { documentID = d.documentID, IDNumber = d.IDNumber, documentName = d.documentName, document = d.document, fullname = d.fullname, PolicyHolderIDN = d.PolicyHolderIDN }).ToList() }).ToList()); } } }
public List <ProfileApplicationDocuments> OutstandingDocList(string IDNum) { if (IDNum != null) { using (var Holder = new PolicyHolderRepository()) { PolicyHolder member = Holder.Find(x => x.IDNumber == IDNum).FirstOrDefault(); if (member != null)// if member was found { using (var padr = new ProfileApplicationDocumentsRepository()) { return((from x in padr.GetAll() where x.PolicyHolderIDN == member.IDNumber select x).ToList()); } } } } return(new List <ProfileApplicationDocuments>()); //list of supporting documents }