c# - 实体框架增量不起作用?给出错误
问题描述
你好,我的代码增量不起作用,因此它给了我错误,我不知道这有什么问题。我的列是主要的,因为自动增量是 ON
foreach (var item in Items)
{
using (var db = new TempDGREntities())
{
//code here auto incrementing
using (var context = new TempDGREntities())
{
try
{
foreach (var car in list)
{
//code here NOT auto incrementing
}
}
catch (Exception ex)
{
}
}
}
}
解决方案
推荐阅读
- uwp - 如何检查特定像素是否透明
- linux - 用于迭代目标文件路径中的特定目录并忽略某些目录的 bash 脚本
- google-apps-script - 元素必须分离
- xamarin - 是否可以将 xamarin 表单连接到在线数据库?
- sql - 插入什么都不做,反之亦然 - Postgresql 中有 2 个表
- android - 当加快构建时间是主要目标时,是否建议在“文件库”上运行 Lint?
- html - 使用css根据其优先级将div缩小为零宽度
- r - 使用 fct_recode 重新编码因子:“`f` 中的未知级别”
- python-3.x - 如何通过python提取YouTube频道中的所有视频链接?
- javascript - Chromium - 功能未定义..几个小时后