2008-10-02 56 views

回答

1
using System.Data.Linq.SqlClient; 

db.Incidents 
    .GroupBy(i => i.City) 
    .Select(g => new 
    { 
    City = g.Key, 
    DownTime = g.Sum(i => SqlMethods.DateDiffMinute(i.StartDate, i.Completed)) 
    });