Linq query for search entities with many-to-many relationships
I have problem with searching.
So, I have Task entity and Owner Entity. They are in many-to-many relationships.
My target - find all Tasks by some Owner. In entity framework datamodel there's no relationship table as outstanding entity.
I create linq-filter expression, but I can't include in it rule for Owners. I tried to use some lambda expression, but compiler asked me to use simple types and no "Owners".

                Expression<Func<Task, bool>> filter = e =>
                    (String.IsNullOrEmpty(filterData.Title) || e.Title.StartsWith(filterData.Title))
                   && (isDueDateSkipped || (DateTime.Compare(dueDate, e.DueDate ?? now) == 0))                       
                   && (isCloseDateSkipped || (DateTime.Compare(closeDate, e.CloseDate ?? now) == 0))
                   && (isTypeSkipped || e.Type.Id == typeId)
                   && (isStatusSkipped || e.Status.Id == statusId)
                   && (isPrioritySkipped || e.Priority.Id == priorityId)
                   && (isMemberSkipped || e.Member.Id == memberId);
Could you please help me?
Linq query for search entities with many-to-many relationships
===

I have problem with searching.
So, I have Task entity and Owner Entity. They are in many-to-many relationships.
My target - find all Tasks by some Owner. In entity framework datamodel there's no relationship table as outstanding entity.
I create linq-filter expression, but I can't include in it rule for Owners. I tried to use some lambda expression, but compiler asked me to use simple types and no "Owners".

                Expression<Func<Task, bool>> filter = e =>
                    (String.IsNullOrEmpty(filterData.Title) || e.Title.StartsWith(filterData.Title))
                   && (isDueDateSkipped || (DateTime.Compare(dueDate, e.DueDate ?? now) == 0))                       
                   && (isCloseDateSkipped || (DateTime.Compare(closeDate, e.CloseDate ?? now) == 0))
                   && (isTypeSkipped || e.Type.Id == typeId)
                   && (isStatusSkipped || e.Status.Id == statusId)
                   && (isPrioritySkipped || e.Priority.Id == priorityId)
                   && (isMemberSkipped || e.Member.Id == memberId);
Could you please help me?