Warapper
的拼写错误? :)编辑:触发此问题的一个具体EF调用基本上是
var db = new MyDbContext(); db.Personnel.Where(a => a.Login == login).SingleOrDefault();
。 此外,EF迁移Seed() AddOrUpdate生成的堆栈与效果相同。 更完整的堆栈跟踪,可能会给出更多上下文,位于此处:Fuller Stack Trace
编辑:一些相关链接:
- MSDN: 性能注意事项 (Entity Framework)(感谢 @AakashM)
- MSDN: EF Power Tools
- SO: 针对大量表格(715个)的Entity Framework 4.1
编辑2:现在他们刚刚开源了代码,看起来这一行:
//Filter the 1:1 foreign key associations to the ones relating the sets used in these cell wrappers.
oneToOneForeignKeyAssociationsForThisWrapper =
oneToOneForeignKeyAssociationsForThisWrapper.Where(
it => (it.AssociationEndMembers.All(endMember => entityTypes.Contains(endMember.GetEntityType()))));
需要进行改进的是第一个部分。它使用了一个O(n^2)算法,但我还没有仔细研究过。
编辑3:令人高兴的是,EF6中的改进正在修复这段代码:http://entityframework.codeplex.com/discussions/396130