Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Using a xref table to filter results

$
0
0

I have 3 entities.  

Hotel
Airport
HotelAirportXref

I am trying to pull back a list of hotels linked to a specific Airport.  Simple in SQL , just my first time doing with EF and LINQ.

            VM._Hotel = db.Hotels                
                .Include(i => i.HotelAirportXrefs)
                //.Where(i => i.HotelAirportXrefs.AirportID==12)
                .Where(x => x.HotelTypeID != 4)
                .Where(x => x.bDeleted==false)
                .ToList();


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>