public async Task <IActionResult> Delete(int id) { var subjectFromDb = await _repo.Detail <Subject>(id); if (subjectFromDb == null) { return(NotFound()); } _repo.Delete(subjectFromDb); if (await _repo.SaveAll()) { return(Ok()); } return(StatusCode(500)); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { if (SelectedTransaction == null) { MessageBox.Show("Entry was not selected!"); } else if (MessageBox.Show("Delete entry?", "Question", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { _transactionManager.Delete(SelectedTransaction.TransactionId); btnDelete_ClickHandler(sender, e); } }
public ActionResult Delete(SuperHeroClient entity) { try { _service.Delete(entity.Id); return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <IActionResult> Delete(int id) { var solicitudServicio = await _solicitudServicioRepository.Get(id); if (solicitudServicio == null) { return(NotFound()); } await _solicitudServicioRepository.Delete(solicitudServicio); return(NoContent()); }
public virtual OperationResult Delete(TKey id) { try { repository.Delete(id); repository.SaveChanges(); return(new OperationResult()); } catch (Exception e) { return(new OperationResult(e.Message)); } }
public async Task <IActionResult> Delete(int id) { var certificateFromDb = await _repo.Detail <Certificate>(id); if (certificateFromDb == null) { return(NotFound()); } _repo.Delete <Certificate>(certificateFromDb); if (await _repo.SaveAll()) { return(Ok()); } return(StatusCode(500)); }
public async Task <IActionResult> Delete(int id) { var levelFromDb = await _repo.Detail <Level>(id); if (levelFromDb == null) { return(NotFound()); } _repo.Delete <Level>(levelFromDb); if (await _repo.SaveAll()) { return(Ok()); } return(BadRequest()); }
public async Task <IActionResult> Delete(int id) { var questionFromDb = await _repo.Detail <Question>(id); if (questionFromDb == null) { return(NotFound()); } _repo.Delete <Question>(questionFromDb); if (await _repo.SaveAll()) { return(Ok()); } return(StatusCode(500)); }
public async Task <IActionResult> Leaving(Enrolled enrolled) { Dictionary <dynamic, dynamic> properties = new Dictionary <dynamic, dynamic>(); properties.Add("AccountId", enrolled.AccountId); properties.Add("SubjectId", enrolled.SubjectId); if (!_repo.Exists <Enrolled>(properties)) { return(NotFound()); } ; _repo.Delete(enrolled); if (await _repo.SaveAll()) { return(Ok()); } return(StatusCode(500)); }
public void Delete <K>(ICRUDRepository repo, params K[] key) { repo.Delete <K>(key); }
public void Delete(T entity) { Log($"In decorator - Before Deleting {entity}"); _decorated.Delete(entity); Log($"In decorator - After Deleting {entity}"); }
public IActionResult Delete(int id) { return(new JsonResult(postCrudRepository.Delete(id))); }
public void Delete(int id) { _repo.Delete(id); }
public void Delete <U>(params U[] key) { repository.Delete(key); }