I have tried to implement lazy and eager loading in EF. Everything seems fine, but the .Include() method is available in both cases and returns the same results irrespective of lazy loading false or true.
I have 2 tables categories and product. Category can have multiple products and related using foreign key.
When I load categories using lazy loading by using .Include("Products"), it loads all products related to categories.
Same behavior is shown by eager loading.
var results = objDB.Categories.Include("Products").ToList(); // Enabled lazy load
var results = objDB.Categories.Include("Products").ToList(); // Disabled lazy load
Above both lines have same result. Please clarify this confusion.
.Include should not be available in case of lazy loading = true.
Please give your valuable opinion. Thanks in advance.