title: Poll System in ASP.NET MVC
body: <p>I want to Display Polling in section of My Page, I have created these POCO classes for do that :</p>
  
  <pre><code>public class Polls
  {
      public int Id { get; set; }
      public string Question { get; set; }
      public bool Active { get; set; }
      public IList&lt;PollOptions&gt; PollOptions { get; set; }
  }
  
  public class PollOptions
  {
      public int Id { get; set; }
      public virtual Polls Polls { get; set; }
      public string Answer { get; set; }
      public int Votes { get; set; }
  }
  </code></pre>
  
  <p>And I have Used below ViewModel :</p>
  
  <pre><code>public class PollViewModel
  {
      public int Id { get; set; }
      public string Question { get; set; }
      public string Answer { get; set; }
  }
  </code></pre>
  
  <p>Then, I passed my model using above ViewModel to my View :</p>
  
  <pre><code>public ActionResult Index()
  {
      var poll = from p in db.Polls
                 join po in db.PollOptions on p.Id equals po.Polls.Id
                 where p.Active == true
                 select new PollViewModel { 
                     Id=p.Id,
                     Question=p.Question,
                     Answer=po.Answer
      };
  
      return View(model);
  }
  </code></pre>
  
  <p>in my View I want to display <code>Question</code> and <code>Answer</code> of my Poll, I have tried this code :</p>
  
  <pre><code>@section Polling{
      @foreach (var item in Model.Polls)
      {
          &lt;input type="radio" /&gt; @item.Answer
      }
  }
  </code></pre>
  
  <p>above code works correctly but I want to display <code>Question</code> too, something like this :</p>
  
  <pre><code>@section Polling{
      **@Model.Polls.Question**
      @foreach (var item in Model.Polls)
      {
          &lt;input type="radio" /&gt; @item.Answer
      }
  }
  </code></pre>
  
  <p>How can I do that?</p>
  
  <p><strong>PS: I have one row in my Polls Table for display in Home Page</strong></p>