public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DiplomaProgramYear = await _context.DiplomaProgramYears .Include(s => s.DiplomaProgram) .Include(s => s.DiplomaProgramYearSections) .ThenInclude(s => s.CourseOfferings) .ThenInclude(s => s.Instructor) .Include(s => s.DiplomaProgramYearSections) .ThenInclude(s => s.CourseOfferings) .ThenInclude(s => s.Semester) .Include(s => s.DiplomaProgramYearSections) .ThenInclude(s => s.CourseOfferings) .ThenInclude(s => s.Course) .Include(s => s.DiplomaProgramYearSections) .ThenInclude(s => s.CourseOfferings) .ThenInclude(s => s.DiplomaProgramYearSection) .ThenInclude(s => s.DiplomaProgramYear) .ThenInclude(s => s.DiplomaProgram) .FirstOrDefaultAsync(m => m.Id == id); if (DiplomaProgramYear == null) { return(NotFound()); } return(Page()); }
// public List<CourseOffering> CourseOfferings { get; set;} public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DiplomaProgramYear = await _context.DiplomaProgramYears // .Include(d => d.DiplomaProgram) // .Include(dpys=> dpys.DiplomaProgramYearSections) // .ThenInclude(dpys => dpys.CourseOfferings) // .ThenInclude(co=> co.Course) // .Include(dpys=> dpys.DiplomaProgramYearSections) // .ThenInclude(dpys => dpys.CourseOfferings) // .ThenInclude(co=> co.Instructor) // .Include(dpys=> dpys.DiplomaProgramYearSections) // .ThenInclude(dpys => dpys.CourseOfferings) // .ThenInclude(co=> co.Semester) // .OrderBy(dpys => dpys.DiplomaProgramYearSections) .FirstOrDefaultAsync(m => m.Id == id); // CourseOfferings = await _context.CourseOfferings.ToList(); if (DiplomaProgramYear == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DiplomaProgramYear = await _context.DiplomaProgramYears .Include(d => d.DiplomaProgram).FirstOrDefaultAsync(m => m.Id == id); if (DiplomaProgramYear == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } DiplomaProgramYear = await _context.DiplomaProgramYears.FindAsync(id); if (DiplomaProgramYear != null) { _context.DiplomaProgramYears.Remove(DiplomaProgramYear); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DiplomaProgramYear = await _context.DiplomaProgramYears .Include(d => d.DiplomaProgram).FirstOrDefaultAsync(m => m.Id == id); if (DiplomaProgramYear == null) { return(NotFound()); } ViewData["DiplomaProgramId"] = new SelectList(_context.DiplomaPrograms, "Id", "Id"); return(Page()); }