Nhibernate QueryOver。从组中获取TimeSpan

时间:2013-01-31 09:51:32

标签: nhibernate queryover

我有一个连接两个表的查询:

Session.QueryOver<Operation>().JoinAlias(operation => operation.Activities, () => activity)

OperationTable | ActivityTable

Operation1 ===&gt; 2013-01-28 12:04:16.247

Operation1 ===&gt; 2013-01-28 14:04:16.247

Operation1 ===&gt; 2013-01-28 16:04:16.247

Operation2 ===&gt; 2013-01-28 18:04:16.247

Operation2 ===&gt; 2013-01-28 19:04:16.247

...

“活动”表格包含日期。我需要通过操作对此查询进行分组:

.SelectList(list => 
    list.SelectGroup(operation => operation.Title).WithAlias(() => reportModel.Title))

为每个操作获取时间段:

Operation1 ===&gt; 4:00:00.000(TimeSpan:组中的最后日期 - 组中的第一个日期)

Operation2 ===&gt; 1:00:00.000

如何创建此类查询?提前致谢!

0 个答案:

没有答案