c# - Lazy loading and eager loading - how can I check that? -
i have poco entity type:
public class blog { public int blogid { get; set; } public string name { get; set; } public string url { get; set; } public string tags { get; set; } public virtual icollection<post> posts { get; set; } } how can check in visual studio debugger query gets blogs:
var result1 = context.blog.tolist(); and query gets blogs posts part of query:
var result2 = context.blog.include(x => x.posts).tolist(); is possible?
on context property regarding lazy loading (context.configuration.lazyloadingenabled) , disabled, add together watch on result1.posts, , nil should have been loaded.
conversely result2.posts should, given inspection, have items. of course, relies on entries in database beingness wired up!
another tell tale sign proxy object on posts, collection have unusual name, if lazy loading enabled.
c# entity-framework
No comments:
Post a Comment