johnix
02-05-2011, 11:24 AM
How can i extend or create dynamic join in linq?
IEnumerable<DataRow> drModel = from cModels
select cModels;
if (true){
drModel = drModel.Join(my statement for join);
}
but I manage the dynamic where like this
drModel = drModel.Where(cModels => cModels.Field<Int64>("Id") == Convert.ToInt64(Id));
Can anybody help me? :(
IEnumerable<DataRow> drModel = from cModels
select cModels;
if (true){
drModel = drModel.Join(my statement for join);
}
but I manage the dynamic where like this
drModel = drModel.Where(cModels => cModels.Field<Int64>("Id") == Convert.ToInt64(Id));
Can anybody help me? :(