Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. ----> I change the following code
  2.  
  3. IQueryable<Trip> query = tripRepository.GetAll()
  4. .InInterval(fromDate, toDate, t => t.CREATE_DATE.Value)
  5. .Include(t => t.Events.Select(e => e.Driver.Missions))
  6. .Include(t => t.FirstLoading)
  7. .Include(t => t.LastDelivery)
  8. .Include(t => t.Missions.Select(m => m.Resources))
  9. .Include(t => t.Tasks.Select(ta => ta.Location))
  10. .Where(t => t.Events.Any());
  11.  
  12.  
  13. To this : --->
  14. IQueryable<Trip> query = tripRepository.GetAll()
  15. .InInterval(fromDate, toDate, t => t.CREATE_DATE.Value)
  16. .Include(t => t.Events.Select(e => e.Driver.Missions))
  17. .Include(t => t.FirstLoading)
  18. .Include(t => t.LastDelivery)
  19. .Include(t => t.Missions.Select(m => m.Resources))
  20. .Include(t => t.Tasks.Select(ta => ta.Location))
  21. .Where(t => t.Events.Any(e => e.TYPE_ID == (int)EBTEnum.EventType.activityStart || e.TYPE_ID == (int)EBTEnum.EventType.activityEnd));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement