public JsonResult GetDepartmentandCourse(long id) { ScheduleViewModel objVM = new ScheduleViewModel(); objVM.CourseList = repository.CourseByOrganization(id); //repository.Find<Course>("select * from Courses where OrganisationId = @id", id); objVM.DepartmentList = repository.DepartmenstByOrganization(id); //repository.Find<Department>("select * from Departments where OrganizationId = @id", id); return Json(objVM, "application/json;", JsonRequestBehavior.AllowGet); }
public JsonResult GetDepartmentandCourse(long id) { ScheduleViewModel objVM = new ScheduleViewModel(); objVM.CourseList = db.Courses.Where(x => x.OrganisationId == id).ToList(); objVM.DepartmentList = db.Departments.Where(x => x.OrganizationId == id).ToList(); return Json(objVM, "application/json;", JsonRequestBehavior.AllowGet); }