【发布时间】:2021-10-10 23:08:15
【问题描述】:
有人可以帮助我吗?购买后我无法更新库存记录,它显示空错误。我无法从数据库中检索原始数据。
这是我的代码:
DBContext db = new DBContext();
var inTB = db.InventoryTBs.Where(s => s.id == customerTB.CustomerID).FirstOrDefault();
inTB.Quantity += customerTB.CQuantity;
db.InventoryTBs.Add(inTB);
db.SaveChanges();
谢谢
【问题讨论】:
标签: c# asp.net-mvc entity-framework inventory-management