using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMISOnline.Entities; using EMISOnline.DataLogic.Repositories; using System.Linq.Expressions; using EMISOnline.ViewModel.Educational; namespace EMISOnline.DataLogic.Educational { public class CollegeDAL { public CollegeRepository CollegeRepository { get; set; } public CampusRepository CampusRepository { get; set; } public IQueryable GetCollegeList(Expression> exp) { var query = from col in CollegeRepository.Entities.Where(exp) join cap in CampusRepository.Entities on col.CampusID equals cap.CampusID select new CollegeView { CollegeID = col.CollegeID, CampusID = col.CampusID, No = col.No, Name = col.Name, EnglishName = col.EnglishName, ParentCollegeID = col.ParentCollegeID, HierarchyID = col.HierarchyID, SimpleName = col.SimpleName, RecordStatus = col.RecordStatus, CreateUserID = col.CreateUserID, CreateTime = col.CreateTime, ModifyUserID = col.ModifyUserID, ModifyTime = col.ModifyTime, CampusName = cap.Name, }; return query; } } }