2010-07-05 84 views
0

如果我只是想最早[活动] [开始时间]我会写:帮助与LINQ声明

events.Min(ev => ev.StartTime); 

如何延长这样说的:

"select the [startTime] for the [event] that has the earliest [appointment] [startTime]" 

(安[事件]已约会预约[预约])

回答

0

按照分钟预约开始时间和采取第一个,如:

events.OrderBy(ev => ev.Appointments.Min(app => app.StartTime)).First().StartTime;