title: How to read ICollection from Model in MVC 5
body: <p>I need to read Icollection from Model in View. I have this situation.</p>
  
  <p>I have 3 classes: Alternative, Question and QuestionAlternative</p>
  
  <p>Class</p>
  
  <pre><code>namespace Models
  {
  public class QuestionAlternative
  {
  
      public int QuestionAlternativeID { get; set; }
      public int QuestionID { get; set; }
      public int AlternativeID { get; set; }
      public virtual Question Question { get; set; }
      public virtual ICollection&lt;Alternative&gt; Alternative { get; set; }
  
   }
  }
  </code></pre>
  
  <p>Question</p>
  
  <pre><code>namespace Models
  {
  public class Question
  {
      public int QuestionID { get; set; }
      public int FactorID { get; set; }
      public string Description { get; set; }
      public string Complement { get; set; }
      public int IndexOrder { get; set; }
      public double Weight { get; set; }
  
      public virtual Factor Factor { get; set; }
  
       }
      }
  </code></pre>
  
  <p>Alternative</p>
  
  <pre><code>namespace Models
  {
  public class Alternative
  {        
      public int AlternativeID { get; set; }
      public string Description { get; set; }
      public double Weight { get; set; }
      public int IndexOrder { get; set; }
       }
      }
  </code></pre>
  
  <p>My Controller</p>
  
  <pre><code>namespace Inventario.Controllers
  {
  
  public class HomeController : Controller
  {
      private InventarioContext db = new InventarioContext();
      public ActionResult Index()
      {
          return View();
      }
  
      public ActionResult Questionnaire()
      {          
          var questionAlternative = db.QuestionAlternatives.Include(qa =&gt; qa.Question).Include(qa =&gt; qa.Alternative);
          return View("../Equipment/Questionnaire", questionAlternative);
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My View</p>
  
  <pre><code>&lt;div class="table-responsive"&gt;
  @using (Html.BeginForm("getRadioValues", "Equipment", FormMethod.Post))
  {
      &lt;table class="table table-bordered table-hover table-striped"&gt;
  
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Nº&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              @foreach (var question in Model.GroupBy(q=&gt;q.Question))
              {
                  &lt;tr&gt;
  
                      &lt;td width="10px"&gt;&lt;b&gt;@question.Key.QuestionID - @question.Key.Description&lt;/b&gt; &lt;/td&gt;
                  &lt;/tr&gt;
                  foreach (var alternative in question)
                  {
                      &lt;tr&gt;
                          &lt;td&gt;
                              @Html.RadioButton("radio" + @question.Key.QuestionID, alternative.QuestionAlternativeID, false)@alternative.Alternative.HOW TO ACCESS THE FIELDS OS &lt;Alternatives&gt; LIST
                          &lt;/td&gt;
  
                      &lt;/tr&gt;
                  }
              }
          &lt;/tbody&gt;
      &lt;/table&gt;
  
      &lt;input id="submit" type="submit" value="submit" /&gt;
      }
  
     &lt;/div&gt;
  </code></pre>
  
  <p>In my view I grouped All alternatives for each question. I need to access the properties of the Alternative class to print the alternatives, but it is a collection in my model . How to do it? How to access public virtual ICollection Alternative { get; set; } inside model</p>