public ActionResult ExcluirItemAgenda(string id) { var consulta = consultaRepository.FindBy(prop => prop.Id == id).FirstOrDefault(); consultaRepository.Delete(consulta); consultaRepository.Save(); return(Json(id)); }
public async Task <long> Delete(long id) { try { var existentConsuta = await _consultaModel.SelectId(id); if (existentConsuta == null) { return(-1); } var deleteRow = await _consultaModel.Delete(id); return(deleteRow); } catch (Exception ex) { log.Error("ConsultaService.Delete: ", ex); throw ex; } }