Maybe something is missing me, but instead of changing the configuration every time, can a different approach use .Include() only in those queries where you want to load?
Suppose we have a Product class that has a navigation property for the Colour class, you can load the Colour for the Product like this, -
var product = _context.Products .Where(p => p.Name == "Thingy") .Include(x => x.Colours) .ToList();
Parrybird Jan 17 '17 at 10:11 2017-01-17 10:11
source share