public IHttpActionResult PostStockBranchInventory(StockBranchInventory stockBranchInventory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.StockBranchInventories.Add(stockBranchInventory); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = stockBranchInventory.Id }, stockBranchInventory)); }
public IHttpActionResult DeleteStockBranchInventory(int id) { StockBranchInventory stockBranchInventory = db.StockBranchInventories.Find(id); if (stockBranchInventory == null) { return(NotFound()); } db.StockBranchInventories.Remove(stockBranchInventory); db.SaveChanges(); return(Ok(stockBranchInventory)); }