有没有更好的方式来写这个?最近我做了很多JavaScript之后,我觉得自己正在用C#生锈。这可以改善吗?LINQ?重构foreach
foreach (var item in this.CartItems)
{
if (item.EffectivePrice != null)
{
this.CartItems[this.CartItems.IndexOf(item)].EffectivePrice =
CurrencyHelper.GetLocalizedCurrency(item.EffectivePrice);
}
}
+1,我不确定这个问题是否非常适合LINQ。 – Sapph 2010-01-22 05:11:52