예제 #1
0
        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));
        }
예제 #2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _repository.DeleteCita(id);

            return(RedirectToAction(nameof(Index)));
        }