【发布时间】:2019-07-31 03:41:25
【问题描述】:
在下表中,您可以看到billid 列在第 10 行增加了 1000。
生成新bill的代码如下:
private void NewBill()
{
var bill = new Bill
{
BillDate = DateTime.Now,
InUse = true,
Paid = false,
TableId = _tableId,
UserId = frmLogIn.LoggedInUserId
};
using (var context = new Context())
{
context.Bills.Add(bill);
context.SaveChanges();
}
}
为什么它不只增加 1 ?
我正在使用带有 SQL Server 2017 Express 版本的 EF6。
【问题讨论】:
-
你为什么在乎?跟EF没关系。执行此操作的是数据库服务器,您无法控制它。
-
你看过你的表定义了吗??
-
这与 EF 没有任何关系 - 这是 SQL Server 中的一个功能 - read more about here on dba.stackexchange.com
标签: c# entity-framework-6