【发布时间】:2015-02-19 10:39:59
【问题描述】:
是否可以在 EF6 中更改实体列表状态
List<AuditTrail> auditLogs = new List<AuditTrail>();
auditLogs = GetLog(context, CreatedBy);
context.AuditTrails.AddRange(auditLogs);
context.Entry(context.AuditTrails).State = System.Data.Entity.EntityState.Unchanged;
它抛出异常。
The entity type DbSet`1 is not part of the model for the current context.
如何实现以上逻辑?
【问题讨论】:
标签: c# asp.net-mvc entity-framework entity-framework-5