Linq for two tables
- by Diana
I need to do something like this,
My two tables have the same signature, but different class so It suppose to work but it is not working.
var myTable;
if (booleanVariable == true)
{
myTable = table1;
}
else
{
myTable = table2;
}
var myLinq1 = from p in myTable
join r in myOtherTable
select p;
In this case, I have to initialize myTable
I have tried also,
var myTablev= table2;
if (booleanVariable == true)
{
myTable = table1;
}
var myLinq1 = from p in myTable
join r in myOtherTable
select p;
then var is type table2, then it can't be changed to table1 type.
I need help, I don't want to make a copy paste of all the code. the linq query is huge, and it s nested with 5 or 6 queries. also I have to do this on 12 different methods.
Thanks a lot for your help.