public OperationResult Delete(DeleteInventoryVM command)
        {
            OperationResult result = new OperationResult();

            var inventory = _inventoryRepository.Get(command.Id);

            if (inventory == null)
            {
                return(result.Failed(ValidateMessage.IsExist));
            }

            inventory.Delete();
            _inventoryRepository.SaveChanges();

            return(result.Succeeded());
        }
Exemplo n.º 2
0
        public IActionResult OnPostDelete(DeleteInventoryVM command)
        {
            var result = _inventoryApplication.Delete(command);

            return(new JsonResult(result));
        }