public async Task <IActionResult> Delete(int?id, Reservation reservation) { if (id == null) { return(RedirectToAction(nameof(Index))); } else { _dbContext.Remove(reservation); await _dbContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } }
public async Task <IActionResult> Delete(Billing billing) { if (billing == null) { return(RedirectToAction(nameof(Index))); } else { _dbContext.Remove(billing); await _dbContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); //return View(billing); } }
public async Task <IActionResult> Delete(int?id, Visitor visitor) { if (ModelState.IsValid) { if (id == null) { return(RedirectToAction(nameof(Index))); } else { _dbContext.Remove(visitor); await _dbContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } } return(View(visitor)); }