Q:

Select multiple tables in related database in vb

Need help with to select 3 related databasetables in one query. The result is supposed to
be copied to my viewmodel. Byt i cant find how to write the query.
I have like this:
Dim l = db.myEntity.Where(Function(m) m.regnr.Contains(regnr) And m.ExtLok = True).Select(Function(m) m.Customer).tolist()

This query only select the one-to-on-related table "Customer", so my question is, how do i select more tables? Ive tried this
Dim l = db.myEntity.Where(Function(m) m.regnr.Contains(regnr) And m.ExtLok = True).Select(Function(m) m.Customer, m.Cars).tolist()

A:

Dim item As myEntity = (from e in db.MyEntities.Include("MoreEntities").Include("OtherEntity") where m.field.contains("criteria") select e)

The key here is calling the Include method on the collection in the In clause.
Take a look at MSDN or Intelisense - Include() has several overloads.

