在linq中具有不同计数的两个表的联合

时间:2015-05-14 21:02:06

标签: entity-framework linq-to-sql

我想结合以下两个查询并将它们放入列表中。怎么做?

var query  = (from a in xactCtxt.XactETL_Activity_Log
                             join b in xactCtxt.XactETL_Shred_Mode on a.ShredModeID equals b.ShredModeID
                             where a.CreatedDate >= startDate && a.CreatedDate <= endDate
                             select new { a.ActivityLogID,a.ShredQueueCount,a.ShredCompletedCount,a.ShredValFailureCount,a.ShredExceptionCount, a.CreatedDate, b.ShredModeStatus })                                
                             .ToList();

                var historyCount = (from h in source.Histories
                                    where h.TransactionDate >= startDate && h.TransactionDate <= endDate
                                    select h).Count();

0 个答案:

没有答案