public async Task <IActionResult> Edit(int id, [Bind("Id,Property_Type,Area,Price,Facilities")] Property_Detail property_Detail) { if (id != property_Detail.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(property_Detail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Property_DetailExists(property_Detail.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(property_Detail)); }
public async Task <IActionResult> Create([Bind("Id,Property_Type,Area,Price,Facilities")] Property_Detail property_Detail) { if (ModelState.IsValid) { _context.Add(property_Detail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(property_Detail)); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Property_Detail = await _context.Property_Detail.FirstOrDefaultAsync(m => m.Id == id); if (Property_Detail == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Property_Detail = await _context.Property_Detail.FindAsync(id); if (Property_Detail != null) { _context.Property_Detail.Remove(Property_Detail); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }