public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Sanatci = await _context.Sanatci .Include(s => s.Sehir).FirstOrDefaultAsync(m => m.ID == id); if (Sanatci == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Sanatci = await _context.Sanatci.FindAsync(id); if (Sanatci != null) { _context.Sanatci.Remove(Sanatci); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Sanatci = await _context.Sanatci .Include(s => s.Sehir).FirstOrDefaultAsync(m => m.ID == id); if (Sanatci == null) { return(NotFound()); } ViewData["SehirID"] = new SelectList(_context.Sehir, "ID", "SehirAdi"); return(Page()); }