public async Task <IActionResult> PostInventoryMaster([FromBody] InventoryMaster InventoryMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } //_context.InventoryMaster.Add(InventoryMaster); try { //await _context.SaveChangesAsync(); await _inventory.AddInventory(InventoryMaster); } catch (DbUpdateException) { if (InventoryMasterExists(InventoryMaster.InventoryID)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } return(CreatedAtAction("GetInventoryMaster", new { id = InventoryMaster.InventoryID }, InventoryMaster)); }
public int AddInventory(BllInventoryTable BIModel) { return(dal.AddInventory(BIModel)); }