下面这段代码在 prizeGroup.ForEach(delegate(var item)这个地方为什么会提示无法从匿名方法转换为System.Action<...>的错误,应该怎么改正呢?
没有币了,哪位大哥哥,指点一下喽,小女子在这先谢谢啦!
var prizeGroup = prizeDetailCollection.GroupBy((T_PrizeDetail m) => m.UserId, (Guid key, IEnumerable c) => new
{
Key = key,
C1 = c.Sum((T_PrizeDetail n) => n.Currency_1),
C2 = c.Sum((T_PrizeDetail n) => n.Currency_2) + c.Sum((T_PrizeDetail n) => n.Currency_10)
}).ToList();
int index = 0;
prizeGroup.ForEach(delegate(var item)
{
if (item.C1 > 0m)
{
}
if (item.C2 > 0m)
{
}
});