public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } OutletOpeningTime = await _context.OutletOpeningTime .Include(o => o.Outlet).FirstOrDefaultAsync(m => m.OutletOpeningTimeID == id); if (OutletOpeningTime == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } OutletOpeningTime = await _context.OutletOpeningTime .Include(o => o.Outlet).FirstOrDefaultAsync(m => m.OutletOpeningTimeID == id); if (OutletOpeningTime == null) { return(NotFound()); } ViewData["OutletID"] = new SelectList(_context.Outlet, "OutletID", "Address1"); return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } OutletOpeningTime = await _context.OutletOpeningTime.FindAsync(id); if (OutletOpeningTime != null) { _context.OutletOpeningTime.Remove(OutletOpeningTime); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }