title: How to run a list of a class in cshtml
body: <p>I'm working on asp.net core 2.0, in an mvc project. I have a class called <code>Compra</code> with a list of <code>Combos</code>. My question is, how can I list all combos and show them to the user?</p>
  
  <p>My code for the class "Compra" is this:</p>
  
  <pre><code>public class Compra
  {
      public int ID { get; set; }
      List&lt;Combo&gt; Compras = new List&lt;Combo&gt;()
  }
  </code></pre>
  
  <p>The view that I want to show to the user is a cshtml, I want it to be displayed like this if possible: </p>
  
  <h2>Compra</h2>
  
  <h3>Selected Combos</h3>
  
  <ol>
      <li>Element 1</li>
      <li>Element 2</li>
      <li>Element 3</li>
      <li>Element 4</li>
      <li>Element 5</li>
  </ol>
  
  <p>Thanks in advance, David.</p>