Dynamic joins in Linq
Posted on 2010-08-23
Is it possible to use dynamic joins in Linq where the specific tables that will be joined are not known in advance. We do know what the join conditions will be for all tables, but not the exact tables that will be used. The application gathers user search criteria from forms, then
at that point the tables needed are known. Linq works for us when the tables needed are known in advance, but when the where condition dictates what tables we need we can't get around this problem of not knowing the tables in advance. There are too many possible tables so we don't want to construct a massive view that has everything joined up in advance and model that. Any ideas or examples if this is possible would be appreciated.