예제 #1
0
        public async Task Delete(int id)
        {
            var result = await _componentRepository.Delete(id);

            if (!result)
            {
                throw new ArgumentException($"Cant delete component {id}", nameof(id));
            }
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
 }
예제 #5
0
 public bool Delete(int id, string tokenLogin)
 {
     return(componentRepository.Delete(id, tokenLogin));
 }
예제 #6
0
 public bool Delete(int id)
 {
     return(componentRepository.Delete(id));
 }
예제 #7
0
 // 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));
        }