I want to comment on what I found out, and the solution I found for my problem can help someone. There are some limitations in CRM LINQ as described here.
The first thing I found having an entity reference:
CrmEntityReference Caller { Guid ID; string name; }
I can select Caller.name, but I CANNOT have Caller.name in the where clause. Solution for this -> Attach table
The second limitation is when we have joins in the query, we can have different tables if they are AND predicates, we must write two sentences, for example:
where cal.FullName.Contains(searchTerm) where sub.Title.Contains(searchTerm)
But the problem arises when instead of AND we need to use the OR predicate, the only solution we have is two queries and after combining these queries.
I have four requests for a call that can be executed with only one, now at the development stage the performance is good due to the number of records, but we will see how it works at the testing stage.
Jorge source share