I am using EF 6.1.1 and I am trying to drop data using the LINQ query below. I could write this query manually in less than 30 lines, but the entity structure does it in THOUSAND. See SQL below, am I missing something?
LINQ
_UserRepository
.Query()
.Include(a => a.PaymentSchedules)
.Include(a => a.Profile.ProfileImages)
.Include(a => a.Profile.ProfileImages.Select(c => c.Image.HomePageImage))
.Include(a => a.Profile.ProfileImages.Select(i => i.Image.HoverOverImage))
.AsQueryable()
.Where(a => a.PaymentSchedules.Any(p => p.Active == true && p.DatePaid > eighthOfMonth))
.Where(a => a.Profile.ProfileImages.Any(prof => prof.CurrentImage == true))
.Select(a => a.Profile)
.OrderBy(a => a.Id)
.Skip(skipInt)
.Take(takeInt)
.ToList();
SQL
** Stackoverflow doesn't even let me publish SQL because it is more than 100K characters long and contains more than 200 left connections !!
Please, help.
** Edited: Copy failure failed.
A.Fry source
share