title: Razor, TextBoxFor for ICollection property
body: <p>//Product </p>
  
  <pre><code>public class Product
  {
      [Key]
      public int ID {get; set;}
      public string PK {get; set;}
  
      [Required(ErrorMessage="Category is required field.")]
      public int CategoryID { get; set; }
  
      [Required]
      public string Title {get; set;}
  
      public virtual ICollection&lt;Pricing&gt; Pricing { get; set; }
  }
  </code></pre>
  
  <p>// Pricing </p>
  
  <pre><code>public class Pricing
  {
      [Key]
      public int ID {get; set;}
      public int ProductID {get; set;}
      public decimal Price {get; set;}
      public int OrderQty {get; set;}
      public string PK { get; set; }
  }
  </code></pre>
  
  <p>I have like above entities table, and I want to draw <strong>5 textbox for the ICollection</strong> in update product page. But I have no idea, how should I do.</p>
  
  <pre><code>@model BrownieDAL.Entities.Product
  
  
  &lt;th&gt; Price / Order Qty&lt;/th&gt;
  &lt;td&gt;
      @{int priceCnt = 0;}
      @foreach(var price in Model.Pricing){
          priceCnt++;
          @Html.TextBoxFor(model =&gt; price.Price)
          @Html.TextBoxFor(model =&gt; price.OrderQty)
          &lt;br /&gt;
      }
      @if (priceCnt &lt; 5)
      {
          // ??? 
          @Html.TextBoxFor(Model.Pricing =&gt; Model.Pricing.Price)
          priceCnt++;
      }
  &lt;/td&gt;
  </code></pre>
  
  <p>When I tried with '@Html.TextBoxFor(Model.Pricing => Model.Pricing.Price)', I got an error that say:</p>
  
  <pre><code>Error   1   'System.Collections.Generic.ICollection&lt;PJ.Entities.Pricing&gt;' does not contain a definition for 'Price' and no extension method 'Price' accepting a first argument of type 'System.Collections.Generic.ICollection&lt;PJ.Entities.Pricing&gt;' could be found (are you missing a using directive or an assembly reference?)   
  </code></pre>
  
  <p>Anybody know, how should I do for drawing textbox for the ICollection&lt;> property?</p>