List<Customer> results = null;
using(var adapter = new DataAccessAdapter())
{
var metaData = new LinqMetaData(adapter);
var q = (from c in metaData.Customer
where c.Address.Country == "USA"
select c)
.ProjectToCustomer();
results = q.ToList();
}
You write the query you want, the ProjectToCustomer simply transforms the resultset to a set of DTOs. If you have a nested Address element in the Customer, that's OK, it will fetch the related address elements for the customers in the resultset (which all are from 'USA' as the predicate filtered them out)