public IHttpActionResult DeleteCita(int id) { Cita cita = citaRepository.GetCitaByID(id);//await db.Citas.FindAsync(id); if (cita == null) { return(NotFound()); } //db.Citas.Remove(cita); //await db.SaveChangesAsync(); citaRepository.DeleteCita(id); citaRepository.Save(); return(Ok(cita)); }
public async Task <IActionResult> DeleteConfirmed(int id) { await _repository.DeleteCita(id); return(RedirectToAction(nameof(Index))); }