public async Task <IActionResult> GetStudents([DataSourceRequest] DataSourceRequest request) { try { return(Json(await request.GetDataSourceResult <EnrollmentModel, Enrollment>(this._schoolRepository, KendoUIHelpers.GetIncludes <EnrollmentModel>(i => i.Include(s => s.CourseTitle), i => i.Include(s => s.StudentName))))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> Get([DataSourceRequest] DataSourceRequest request) { try { return(Json(await request.GetDataSourceResult <CourseModel, Course>(this._schoolRepository, KendoUIHelpers.GetIncludes <CourseModel>(i => i.Include(s => s.DepartmentName))))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> Get([DataSourceRequest] DataSourceRequest request) { try { return(Json(await request.GetDataSourceResult <StudentModel, Student>(this._schoolRepository))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> Get([DataSourceRequest] DataSourceRequest request) { try { return(Json(await request.GetDataSourceResult <InstructorModel, Instructor>(this._schoolRepository, KendoUIHelpers.GetIncludes <InstructorModel>(i => i.Include(s => s.Courses).ThenInclude(c => c.CourseTitle), i => i.Include(s => s.OfficeAssignment))))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> GetStudents([DataSourceRequest] DataSourceRequest request) { try { return(Json(await request.GetDataSourceResult <StudentModel, Student>(this._schoolRepository))); //return Json(await Task.Run(() => request.GetDataSourceResult<StudentModel, Student>(this._context.Students, this.mapper))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> Get([DataSourceRequest] DataSourceRequest request) { try { //return Json(await Task.Run(() => request.GetDataSourceResult<DepartmentModel, Department>(this._context.Departments, this.mapper, Help.GetIncludes<DepartmentModel>(i => i.Include(s => s.AdministratorName))))); return(Json(await request.GetDataSourceResult <DepartmentModel, Department>(this._schoolRepository, KendoUIHelpers.GetIncludes <DepartmentModel>(i => i.Include(s => s.AdministratorName))))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }