ミニで基本的なショッピング バスケットを作成するように依頼されました。コードは機能していましたが、最近、配列を検索するために作成した for ループがループ内のすべてのコードをスキップしています。以下のコードを提供しました。
for (int i = 0; i < OrderItems.Count; i++)
    {
        //if a match is found it will add to the to the current quantity
        if (OrderItems[i].ProductName == productName)
            OrderItems[i].AddItem(latestValue, quantity);
         //If no match was found in the list it will get added
        else
            OrderItems.Add(new OrderItem(productName, latestValue, quantity));
    }
私はかなり新しいC#であり、ばかげたことを見逃している可能性があります提供できるヘルプをありがとう