title: For each loop with submitting form
body: <p>Model Room:</p>
  
  <pre><code>public class Room
      {
          public int Id { get; set; }
          public string NumberRoom { get; set; }
          public double CostPerNight { get; set; }
          public virtual Category Category { get; set; }
  }
  </code></pre>
  
  <p>My view model code</p>
  
  <pre><code>public class RoomModel
      {
          public IList&lt;Room&gt; Rooms { get; set; }
      }
  </code></pre>
  
  <p>My Razor code:</p>
  
  <pre><code>@model hotel.Models.RoomModel
  
  @using (Html.BeginForm("ComfortLevelView", "Category"))
          {
              for (int i = 0; i &lt; Model.Rooms.Count(); i++)
               {
                       &lt;table class="simple-little-table" cellspacing='0'&gt;
                           &lt;tr&gt;
                               &lt;td&gt;@Html.DisplayFor(m =&gt; Model.Rooms[i].NumberRoom) &lt;/td&gt;
                               &lt;td&gt;@Html.DisplayFor(m =&gt; Model.Rooms[i].Categoryid)&lt;/td&gt;
                               &lt;td&gt;@Html.DisplayFor(m =&gt; Model.Rooms[i].NumberOfSeats) &lt;/td&gt;
                               &lt;td&gt;
                                   @{ var result = Model.Rooms[i].CostPerNight * numberNights; }
                                   &lt;p&gt;@ViewBag.NumberNights ночей&lt;/p&gt;:@result
                               &lt;/td&gt;
                               &lt;td&gt;
                                   &lt;input type="submit" id="submit" value="Booking" /&gt;
                               &lt;/td&gt;
                           &lt;/tr&gt;
                       &lt;/table&gt;
                   &lt;/div&gt;
               }
          }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult ComfortLevelView(int NumberNights, int CategoryId, int NumberPeoples ,DateTime SelectedDate)
          {
              IRoomService roomService = new RoomService();;
              return View(roomService.GetRoomsByCategory(CategoryId, SelectedDate, NumberNights, NumberPeoples));
          }
  
  [HttpPost]
  public ActionResult ComfortLevelView(RoomModel model)
  {
      //
  }
  </code></pre>
  
  <p>The model item passed into the dictionary is of type 'System.Data.Entity.Infrastructure.DbQuery`1[Hotel.BusinessObject.Room]', but this dictionary requires a model item of type 'hotel.Models.RoomModel'.</p>