using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.ViewModel.SupervisionManage; using System.Linq.Expressions; using EMIS.Entities; using EMIS.DataLogic.Repositories; namespace EMIS.DataLogic.SupervisionManage { public class SupervisionCollegeDAL { public SupervisionCollegeRepository SupervisionCollegeRepository { get; set; } public CollegeRepository CollegeRepository { get; set; } public IQueryable GetSupervisionCollegeViewQuery(Expression> exp) { var sql = (from supervisionCollege in SupervisionCollegeRepository.GetList(exp) from college in CollegeRepository.Entities.Where(x => x.CollegeID == supervisionCollege.CollegeID).DefaultIfEmpty() select new SupervisionCollegeView { SupervisionCollegeID = supervisionCollege.SupervisionCollegeID, Name = supervisionCollege.Name, CollegeID = college.CollegeID, CollegeNo = college.No, CollegeName = college.Name }); return sql; } } }