Foreach==>If==>Return的解读

 foreach (ShoppingCartItem shoppingCartItem in Items)
            {
                if (shoppingCartItem.ProductId == item.ProductId)
                {
                    return;
                }
            }

解读:当《shoppingCartItem.ProductId == item.ProductId》时什么都不返回。

posted on 2008-12-22 10:20  草原和大树  阅读(269)  评论(0编辑  收藏  举报