public async Task <IActionResult> OnGetAsync(string id) { if (id == null) { return(NotFound()); } Property = await _context.Properties .Include(c => c.Client).FirstOrDefaultAsync(m => m.PropertyID == id); if (Property == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(string id) { if (id == null) { return(NotFound()); } Property = await _context.Properties.FindAsync(id); if (Property != null) { _context.Properties.Remove(Property); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(string id) { if (id == null) { return(NotFound()); } Property = await _context.Properties .Include(c => c.Client).FirstOrDefaultAsync(m => m.PropertyID == id); if (Property == null) { return(NotFound()); } ViewData["ClintID"] = new SelectList(_context.Clients, "ID", "ID"); return(Page()); }