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();
Given the code above, the following will work
transactions.Union(cases);
However, the following will not work
transactions.Union(interactions);
Since transactions and cases are returned by Linq.IQueryable , but the last one is Linq.ParallelQuery because it joins another table.
I need this functionality mainly to create the Union. interactions.Union(transactions) or transactions.Union(interactions) one with the other.
c # linq linq-to-objects linq-to-entities entity-framework
Elangesh
source share