2
我有一個包含日期的對象MyObject。 我有以下查詢,其中TheMonth和的某些地方是參數:linq組聲明
var MyQuery = from a in MyModelDC.MyTable
where a.Month == TheMonth
where a.Year == TheYear
select new MyObject
{
var1 = a.Day,
var2 = (from b in MyModel.MyTable
where b.Month == a.Month
where b.Year == a.Year
select b.Identity).Count()
};
我想組的結果,以使每天只發生一次。變量2是一個計數,並且此時計數行正在爲每個身份發生重複,而不是每天唯一。
謝謝。
好吧,我得到的概念;我如何提取MyObject? – frenchie 2011-01-19 23:49:55