You can do that, yes. Alternative method-chaining syntax:
var prodts = Product.
Join(
context.ProductApplications,
req => req.ProductGUID,
prod => prod.ProductGUID,
(req, prod) => req
);
This returns IEnumerable<Product>
. The Join method takes IEnumerable<>
as the first parameter, so what is going to actually happen is the DB will get queried and context.ProductApplications
will be fetched and the results will be enumerated. The resulting object will be used for "joining" with your Product
collection.
Update
According to your comments, you have some GUIDs
in the Product(s?)
collection and you want to fetch all the entities from context.ProductApplications
that "match" those GUIDs
(correct me if I am wrong). If that's the case, you don't really need a join
.
var prodts = context.
ProductApplications.
Where(pa => Product.
Select(p => p.ProductGUID).
Contains(pa.ProductGUID)
);