Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public IEnumerable<Route> GetAll(int locationId)
  2. {
  3. _db.Configuration.ProxyCreationEnabled = false;
  4. return _db.Routes.Include(o => o.ConnectionPointRoutes.Select(s => s.Segment))
  5. .Include(o => o.ConnectionPointRoutes.Select(c => c.ConnectionPoint)
  6. .Where( c => c.Location.LocationId == locationId)).ToList();
  7. }
  8.  
  9. public IEnumerable<Route> GetAll(int locationId)
  10. {
  11. return _db.Routes
  12. .Include(o => o.ConnectionPointRoutes.Select(s => s.Segment))
  13. .Include(o => o.ConnectionPointRoutes.Select(c => c.ConnectionPoint))
  14. .Where(c => c.ConnectionPointRoutes.Select(s => s.ConnectionPoint.Location)
  15. .FirstOrDefault(q => q.LocationId == locationId).LocationId == locationId)
  16. .ToList();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement