I have an Entity Framework query that I need to then join to a non-EF list of results obtained from a dtSearch query. Each list contains unique fields that I will need to display, along with a common "DocId" field. Attempting to simply join the two lists together results in an "Unable to create a constant value of type ..." message.
I could create the join manually (cycle through the Db results and for each record find the match in the non-DB results, then merge the two together in a new list), but that seems woefully inefficient. Is there a better way to handle this?
The easiest way to do so would be to slap a
.ToList()
at the end of your EF query, which will then bring all of the objects into cache, and then you can do the join after that. It shouldn't give you that message afterwards (or least at that point it won't be because of EF), since the data will already have been returned.