public static int Delete(InventoryItem inventoryItem) { using (ObjectConnection objectConnection = new ObjectConnection()) { using (DeleteInventoryItemByInventoryItemIdCommand objectCommand = new DeleteInventoryItemByInventoryItemIdCommand(objectConnection)) { objectCommand.InventoryItemId = inventoryItem.InventoryItemId; objectConnection.Open(); objectCommand.ExecuteNonQuery(); return objectCommand.ReturnValue; } } }
public static int Delete(InventoryItem inventoryItem) { using (ObjectConnection objectConnection = new ObjectConnection()) { using (DeleteInventoryItemByInventoryItemIdCommand objectCommand = new DeleteInventoryItemByInventoryItemIdCommand(objectConnection)) { objectCommand.InventoryItemId = inventoryItem.InventoryItemId; objectConnection.Open(); objectCommand.ExecuteNonQuery(); return(objectCommand.ReturnValue); } } }