/// <summary> /// Deletes a specific clinic /// </summary> /// <param name="id">The id of the clinic</param> /// <returns>OkResult if the clinic is deleted</returns> // DELETE: api/clinic/5 public IHttpActionResult Delete(int id) { if (_clinicRepository.Delete(id)) { return(Ok()); } return(NotFound()); }
public async Task <ApiResult <bool> > DeleteAsync(int id) { _logger.LogInformation(_localizer["LogMethodCalled", "api/Clinic/Delete"]); ApiResult <bool> response = await _clinicRepository.Delete(id); _logger.LogInformation(_localizer["LogMethodResult", "api/Clinic/Delete", response.Deserialize()]); return(response); }
public bool Remove(int patientId) { try { var patient = _patientRepository.GetById(patientId); var result = _patientRepository.Delete(patient); return(result); } catch (Exception ex) { throw ex; } }
public bool Remove(int appointmentId) { try { var appointment = _appointmentRepository.GetById(appointmentId); var result = ValidateCancel(appointment) ? _appointmentRepository.Delete(appointment) : false; return(result); } catch (Exception ex) { throw ex; } }
public ActionResult DeleteConfirmed(int id) { try { repository.Delete(id); return(RedirectToAction("Index")); } catch (Exception ex) { //If an exception is thrown, log the error and return null. log.Error(string.Format("An error has been encountered deleting clinic {0}. Exception Message: {1}", id, ex)); return(null); } }
public IActionResult DeleteConfirmed(int id) { _db.Delete(id); _db.Save(); return(RedirectToAction(nameof(Index))); }
/// <summary> /// Delete /// </summary> /// <param name="id">The id of a record.</param> /// <returns>True if the record was deleted, false otherwise.</returns> public bool Delete(string id) { var myData = repository.Delete(id); return(myData); }
public IActionResult Delete(int id) { _clinicRepository.Delete(id); return(RedirectToAction("index")); }
public ActionResult Delete(string id) { _repository.Delete(id); return(RedirectToAction(nameof(List))); }