title: Add item's to list dynamically in C#
body: <p>So i am trying to take input item's in list , but it is adding only one item.</p>
  
  <p>What am i doing wrong</p>
  
  <pre><code>public void AddItems(List&lt;Things&gt; thing)
   {
      Console.Write("\nEnter Product ID : ");
      int choice = Convert.ToInt32(Console.ReadLine());
      Console.Write("\nEnter Quantity : ");
      int quantity = Convert.ToInt32(Console.ReadLine());
      var item = thing.FirstOrDefault(i =&gt; i.ID == choice);
  
     if (item.ID == choice)
       {
         List&lt;SelectedThing&gt; selectedthing = new List&lt;SelectedThing&gt;();
         {
            var total = item.Price * quantity;
            selectedthing.Add(new SelectedProduct(this.ID = item.ID, this.Price = item.Price, this.Quantity = quantity, this.Name = item.Name));
            foreach (var items in selectedthing)
             {
               Console.WriteLine("\nYou Selected {0} and {1} quantity.Total Is {2:C}\n", items.Name, quantity, total);
              }
          }
     }
  Console.WriteLine("\nWant To Add More Item..?? Press Y for Yes or E to End \n");
  Console.Write("\nYour Option  : ");
  string repeat = Console.ReadLine().ToLower();
   if (repeat == "y")
   {
     AddItems(thing);
    }
  }
  </code></pre>
  
  <p>Now when the process is repeated <strong>after pressing y</strong>, it is not adding one more item in list <strong><code>List&lt;SelectedThing&gt;</code></strong>,it shows only one item.</p>