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