public async Task <IHttpActionResult> Delete([FromODataUri] int StockItemID)
        {
            var item = await _service.FindAsync(StockItemID);

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

            item.ObjectState = ObjectState.Deleted;

            _service.Delete(item);
            await _unitOfWorkAsync.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
 public IActionResult Delete(int id)
 {
     stockItemService.Delete(id);
     return(Ok());
 }