var total = (from a in all
                             join g in group_M
                                       on new { MetricPointID = a.MetricPointID, UsageDate = a.UsageDate }
                                       equals new { MetricPointID = g.MetricPointID, UsageDate = g.MaxUsageDate }
                             select new
                             {
                                 MetricPointID = a.MetricPointID,
                                 TotalMonth = a.TotalMonth,
                                 TotalYear = a.TotalYear,
                                 AlertTotalMonth = a.AlertTotalMonth,
                                 AlertTotalYear = a.AlertTotalYear,
                             }).ToList();

 

多条件就使用匿名类

05-06 23:21