I’ve got 4 unrelated entities and I would like to query them for a certain keyword. Each entity had a LastModified field and I would like to return the top 50 result of the search over the 4 tables order by the LastModified field. Is this even possible?
In the past I’ve used a view to do this kind of stuff… but I don’t understand how to achieve it with EF Code First.
You will need to:
The first two can be done with LINQ to Entities, the latter three with LINQ to Objects.
EDIT This approach would look something like:
If each of the
MakeSharedFromXmethods can be replaced by a lambda (to give an expression tree) which is limited to operators and functions that LINQ to Entities supports, then drop theAsEnumerableandTakecalls from the concatenation step and all can be carried out server side.