public virtual IHttpActionResult Delete(int id)
 {
     return(ExecuteValidatedAction(() =>
     {
         Crudservice.Delete <T>(id);
         return Ok();
     }));
 }
        protected virtual void Delete(ExecutionEvent executionEvent, Guid id)
        {
            ICRUDService <T> crudService = (ICRUDService <T>)ServiceActivator.Get(HandlerUtils.DTO_TO_SERVICE[typeof(T)]);

            Connection.GetInstance().StartTransaction();
            crudService.Delete(id);
            Connection.GetInstance().EndTransaction();
        }
 public ActionResult <TModel> Delete(int id)
 {
     if (_crudService.Delete(id) != null)
     {
         return(Ok());
     }
     return(NotFound());
 }
        public virtual async Task <IActionResult> Delete(int id)
        {
            var result = await _crudService.Delete(id);

            if (!result.Succeeded)
            {
                return(WithStatusCode(result.StatusCode, result.Message));
            }

            return(NoContent());
        }
Beispiel #5
0
        private async void DeleteGameButton_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show($"Do you really want to delete {game.Name}?", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (game != null && result == DialogResult.Yes)
            {
                await _gameService.Delete(game.Id);

                RefreshGames();
            }
        }
        public async Task <ActionResult <bool> > Delete(int id)
        {
            var response = await _service.Delete(id);

            if (response == false)
            {
                return(NoContent());
            }

            return(Ok(response));
        }
        public virtual async Task <Response> Delete(uint id)
        {
            var model = await Service.FindAsync(id);

            if (model == null)
            {
                throw new ResourceNotFoundNsException(id);
            }

            Service.Delete(model);

            return(await Success());
        }
Beispiel #8
0
        private async void DeleteCategoryButton_Click(object sender, EventArgs e)
        {
            if (category.Count > 0)
            {
                MessageBox.Show("Category have link to game!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            DialogResult result = MessageBox.Show($"Do you really want to delete {category.Name}?", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (category != null && result == DialogResult.Yes)
            {
                await _categoryService.Delete(category.Id);

                RefreshCategories();
            }
        }
        public async Task <ServiceResult> Delete(int id)
        {
            var entity = await _dbContext.Radnici.FindAsync(id);

            if (entity == null)
            {
                return(ServiceResult.NotFound($"Radnik sa ID-em {id} nije pronadjen"));
            }

            await _licniPodaciService.Delete(entity.LicniPodaciId);

            await _korisnikService.Delete(entity.KorisnickiNalogId);

            await Task.Run(() => { _dbContext.Remove(entity); });

            return(ServiceResult.NoContent());
        }
        public ActionResult DeleteConfirmed(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var existFlower = mySQLFlowerService.Detail(id);

            if (existFlower == null || existFlower.IsDeleted())
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
            if (mySQLFlowerService.Delete(existFlower, ModelState))
            {
                return(RedirectToAction("Index"));
            }
            return(RedirectToAction("Index"));
        }
Beispiel #11
0
 public void Delete(int id)
 {
     _service.Delete(id);
 }
Beispiel #12
0
 public void Delete(int id)
 {
     _crudService.Delete(id);
 }
 public ActionResult <string> Delete(int id)
 {
     return(_service.Delete(id));
 }
        public T Delete(int id)
        {
            _user = _korisnikService.GetUserIdentity(this.User.Identity as ClaimsIdentity);

            return(_service.Delete(id, _user));
        }
 public HttpResponseMessage Delete(int id)
 {
     return(_service.Delete(id));
 }
 public TModel Delete(int Id)
 {
     return(_service.Delete(Id));
 }
Beispiel #17
0
 public virtual ActionResult Delete([FromRoute] Guid guid)
 {
     return(ServiceInvocationResult(() => ServiceController.Delete(guid) ? new StatusCodeResult(StatusCodes.Status204NoContent) : NotFound()));
 }
Beispiel #18
0
 public async Task <bool> Delete(int ID)
 {
     return(await _service.Delete(ID));
 }
Beispiel #19
0
        public static async Task <ActionResult> Delete <T, TKey>(this Controller controller, ICRUDService <T, TKey> manager, IEnumerable <TKey> ids) where T : class where TKey : IComparable
        {
            await manager.Delete(ids);

            return(controller.NoContent());
        }
Beispiel #20
0
 public T Delete(int Id)
 {
     return _service.Delete(Id);
 }
Beispiel #21
0
 public async Task <T> Delete(int id)
 {
     return(await _crudService.Delete(id));
 }
 public bool Delete(string slug)
 {
     return(_service.Delete(slug));
 }
 public async Task<bool> Delete(int id)
 {
     return await _service.Delete(id);
 }
Beispiel #24
0
 public virtual TModel Delete(int id)
 {
     return(_service.Delete(id));
 }
 public T Delete(int id)
 {
     return(_crudService.Delete(id));
 }
Beispiel #26
0
 public ActionResult <bool> Delete(int id)
 {
     return(_service.Delete(id));
 }
Beispiel #27
0
 public string Delete(int id)
 {
     CRUDservis.Delete(id);
     return("Radnja obavljena");
 }
Beispiel #28
0
 public T Delete(int id)
 {
     return(_service.Delete(id));
 }
Beispiel #29
0
 public IActionResult Delete(int  id)
 {
     _ProductService.Delete(id);
     return RedirectToAction("Index");
 }