基本的に、where ステートメントだけでなく、クエリ ステートメント全体に基づいて IQueryable を取り込んで IQueryable を返すことができる拡張メソッドを探していると思います。
検索方法に必要なものの例:
IRepository<Person> repository = new Repository<Person>();
var results = repository.GetQuery().Include("Names").Search([dynamic linq here]);
現在、where メソッド内に動的 linq ステートメントを作成する場所があります。
IRepository<Person> repository = new Repository<Person>();
var results = repository.GetQuery().Include("Names").Where([dynamic linq here]);
このアプローチの問題は、実際の動的 linq クエリに SelectMany と Select を含めたいということです。サブ プロパティのサブ プロパティを実際に使用しない限り、Where メソッド内で SelectMany を使用することはできません。次の動的 linq ステートメントのようなことをしたいと思います。
SelectMany("Names").Where("LastName.Contains(@0)", "Smith").Select("Person")