public async Task <IHttpActionResult> Delete(int id)
        {
            ProductAttribute entity = await ProductAttributeService.FindOneAsync(id);

            if (entity == null)
            {
                return(NotFound());
            }
            await ProductAttributeService.DeleteAsync(entity);

            return(Ok(entity.ToModel()));
        }
Exemple #2
0
        public async Task <IActionResult> Delete(int id)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToErrorPage());
            }

            var isActived = await _productAttributeService.DeleteAsync(id);

            if (!isActived)
            {
                return(RedirectToErrorPage());
            }

            return(RedirectToAction(nameof(Index)));
        }
Exemple #3
0
        public async Task <IActionResult> Delete(long id)
        {
            await _productAttributeService.DeleteAsync(id);

            return(Ok());
        }