public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } tCity = await _context.tCity .Include(t => t.province).SingleOrDefaultAsync(m => m.city_id == id); if (tCity == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } tCity = await _context.tCity .Include(t => t.province).SingleOrDefaultAsync(m => m.city_id == id); if (tCity == null) { return(NotFound()); } ViewData["province_id"] = new SelectList(_context.tProvince, "province_id", "province_id"); return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } tCity = await _context.tCity.FindAsync(id); if (tCity != null) { _context.tCity.Remove(tCity); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }