Loading of references in EF7

馋奶兔 提交于 2019-12-01 04:37:43
natemcmaster

EF 7 has implemented eager loading.

Use .Include

var post = context.Blogpost.First(); // post.Author will be null

var post = context.Blogpost.Include(b => b.Author).First(); // post.Author will be loaded

For more information on working with collections, see the answer to this question: How to work with collections

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!