में GroupBy साथ शामिल मैं 5 तालिका जहाँ से मैं का उपयोग कर linq.i डेटा से डाटा पढ़ने में निम्न क्वेरी का उपयोग कर रहा कुछ जानकारी प्राप्त करना चाहते हैं।एकाधिक LINQ
var query = (from GRD in _tblStudents.GetQueryable()
join apt in _tblApplicants.GetQueryable()
on GRD.ApplicantID equals apt.ApplicantID
join cls in _tblClasses.GetQueryable()
on GRD.CityID equals cls.ClassID
join prg in _tblPrograms.GetQueryable()
on cls.ProgramID equals prg.ProgramID
join city in _tblCities.GetQueryable()
on GRD.CityID equals city.CityID
where GRD.AcademicYearID == yearId && cls.ProgramID == programId
group apt by new{apt.Gender} into grouped
select new CityWiseStudentModel
{
CityName=city.CityName,
//'city' does not exist in the current context
Gender = grouped.Count(),
programName=prg.Program,
//'prg' does not exist in the current context
}
);
कैसे मैंशहर से पीआरजी तालिका
संपूर्ण क्वेरी में समूहीकृत वस्तुओं को प्रचारित करने के लिए बस 'शामिल होने' के बजाय 'शामिल होने' का प्रयास करें। ध्यान दें कि आपको क्वेरी को फिर से लिखना होगा क्योंकि आपके पास 'शामिल होने' के बाद सीधे 'शामिल' नहीं हो सकता है (मध्यवर्ती 'चयन' की आवश्यकता है)। – Kryptos