public async Task <IActionResult> DeletePost(int id) { Appointments appointment = null; if (orm == 1) { qdb.rmappointment(id); } else { appointment = await _db.Appointments.FindAsync(id); _db.Appointments.Remove(appointment); await _db.SaveChangesAsync(); } TempData["delete"] = 1; return(RedirectToAction(nameof(Index))); }