SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top