public async Task Delete(int id) { var result = await _componentRepository.Delete(id); if (!result) { throw new ArgumentException($"Cant delete component {id}", nameof(id)); } }
public Component Delete(int id) { IEnumerable <TeamComponent> MyTeamComponents = ITeamComponentRepository.GetAll().Where(x => x.Id == id); foreach (TeamComponent MyTeamComponent in MyTeamComponents) { ITeamComponentRepository.Delete(MyTeamComponent); } Component component = IComponentRepository.Get(id); return(IComponentRepository.Delete(component)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var component = _repository.Get(id); if (component == null) { return(HttpNotFound()); } if (!Request.IsAjaxRequest()) { return(RedirectToAction("Index")); } _repository.Delete(component); _repository.Save(); return(Json("", JsonRequestBehavior.AllowGet)); }
public async Task Delete(Guid id) { await _componentRepository.Delete(id); }
public bool Delete(int id, string tokenLogin) { return(componentRepository.Delete(id, tokenLogin)); }
public bool Delete(int id) { return(componentRepository.Delete(id)); }
// DELETE: api/Client/5 public IHttpActionResult Delete(int id) { return(Ok(_objComponentRepository.Delete(id))); }
public Component Delete(int id) { Component component = IComponentRepository.Get(id); return(IComponentRepository.Delete(component)); }