コード例 #1
0
 public IActionResult Delete(Guid id)
 {
     try
     {
         _inventoryRepository.DeleteInventory(id);
         return(new StatusCodeResult(200));
     }
     catch
     {
         return(new StatusCodeResult(400));
     }
 }
コード例 #2
0
        public IActionResult DeletePost(int?id)
        {
            var obj = _inventoryRepository.GetInventoryById((int)id);

            if (obj == null)
            {
                return(NotFound());
            }

            _inventoryRepository.DeleteInventory(obj);

            return(RedirectToAction("Index"));
        }
コード例 #3
0
        public IHttpActionResult DeleteInventory(int Id)
        {
            try
            {
                _inventoryRepository.DeleteInventory(Id);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
コード例 #4
0
        public async Task <ActionResult <Inventory> > DeleteInventory(long id)
        {
            try
            {
                var result = await inventoryRepository.DeleteInventory(id);

                if (result.Value == null)
                {
                    return(NotFound());
                }
                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
コード例 #5
0
        public async Task <Unit> Handle(DeleteInventoryCommand request, CancellationToken cancellationToken)
        {
            await _repo.DeleteInventory(request);

            return(default);
コード例 #6
0
 public async Task <int> DeleteInventory(Inventory Inventory)
 {
     return(await _IInventoryRepository.DeleteInventory(Inventory));
 }
コード例 #7
0
 public string DeleteInventory(long id)
 {
     return(_inventoryRepository.DeleteInventory(id));
 }
コード例 #8
0
 public IHttpActionResult DeleteInventory(int id)
 {
     return(Ok(_inventoryRepository.DeleteInventory(id)));
 }
コード例 #9
0
 public bool DeleteInventory(System.Int32 InventoryId)
 {
     return(_iInventoryRepository.DeleteInventory(InventoryId));
 }