public async Task <IActionResult> Edit(int id, [Bind("EnquiredId,PropertyId,HasEnquired")] Enquired enquired) { if (id != enquired.EnquiredId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(enquired); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EnquiredExists(enquired.EnquiredId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(enquired)); }
public async Task <IActionResult> Create([Bind("EnquiredId,UserId,PropertyId,HasEnquired")] Enquired enquired) { if (ModelState.IsValid) { _context.Add(enquired); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(enquired)); }