var transactions = from t in context.Transactions
group t.Create_Date_Time by t.Participation_Id
into t1
select new { ParticipationId = t1.Key, CreateDateTime = t1.Max() };
var cases = from c in context.Cases
group c.Create_Date_Time by c.Participation_Id
into c1
select new { ParticipationId = c1.Key, CreateDateTime = c1.Max() };
var interactions = (from i in context.Interactions
join pp in context.Party_Participation on i.Party_Id equals pp.Party_Id
group i.Last_Update_Date_Time.HasValue ? i.Last_Update_Date_Time : i.Create_Date_Time by
pp.Participation_Id
into i1
select new {ParticipationId = i1.Key, CreateDateTime = i1.Max()}).AsQueryable();
Considering the above code, following will work
transactions.Union(cases);
However following will not work
transactions.Union(interactions);
Because transactions and cases both are returning Linq.IQueryable but the last one is Linq.ParallelQuery due to it join with an another table.
I need this functionality basically to make Union. interactions.Union(transactions) or transactions.Union(interactions) one with other.
My answer to this question may be incorrect however I raised up this question primarly for the following problem.
LINQ to Entities Union is throwing an error.
I found a fantastic reply from diceguyd30 and it was solved my problem. Hence I am closing this question in response to my previous question’s answer.