http://msdn.microsoft.com/en-us/library/bb896376.aspx这里说的是加载方法
this.context = new MyEntities();
this.Context.Users.
context . users . load ()
我找不到方法加载我能做什么?
如果没有提供Load
方法,则意味着Users
不是 EntityCollection<User>
。它是ObjectQuery<User>
, ObjectSet<User>
或DbSet<User>
。代替Load
使用:
var data = this.context.Users.ToList();
它也回答了你应该做什么?在开始在文档中搜索之前,您应该学会使用IDE识别正确的类型。