Any ways to shorten this include statement?
var query = Context.Businesses .Include(b => b.Categories) .Include(b => b.Branches.Select(br => br.Address)) .Include(b => b.Branches.Select(br => br.BranchType)) .Include(b => b.Branches.Select(br => br.CustomFields)) .Include(b => b.Branches.Select(br => br.Phones)) .Include(b => b.Branches.Select(br => br.OpeningTimes.Select(ot => ot.WorkingPeriods))); I thought about using a SPROC but I'm unsure how it will know what was returned.
So is there a non hard-coded way to do this shorter than it is? Perhaps an external lambda that treats all the properties of Branch?