public class DataManager { public static void OnlineExamLists(out List<MeritMaste_QuestionPaperSettings> examQuestionSettings, out List<MeritMaster_QuestionBank> questionBanks, string examCode) { using (var dbcontext = new meritmasterEntities()) { //here im getting error at conversion (below line) examQuestionSettings = (from k in dbcontext.MeritMaste_QuestionPaperSettings where k.Status == true && k.ex_code == examCode select k).ToList(); var examsettingslocal = examQuestionSettings.FirstOrDefault(); var kabqu = new List<MeritMaster_QuestionBank>(); var queBank = examsettingslocal == null ? kabqu : (from k in dbcontext.MeritMaster_QuestionBank where k.Status == true && k.Course_ID == examsettingslocal.CourseId select k).ToList(); var questionbanklocal = dbcontext.MeritMaste_QuestionPaperSettings.ToList(); questionBanks = (from es in examQuestionSettings.ToList() join qb in queBank.ToList() on new { p1 = (int)es.CourseId, p2 = (int)es.QuestionIds } equals new { p1 = (int)qb.Course_ID, p2 = (int)qb.ID } where es.ex_code == examCode && es.Status == true && qb.Status == true select qb).ToList(); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)