title: Templates can be used only with field access, property access in Razor
body: <p>I got this error when I was creating a Edit and Templating for <code>Product</code>.</p>
  
  <pre><code>Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
  </code></pre>
  
  <p><strong>Edit</strong> In my Razor View:</p>
  
  <pre><code> &lt;p&gt;
    @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  &lt;table&gt;
      &lt;tr&gt;
      &lt;th&gt;
        @Html.DisplayNameFor(model =&gt; model.Select(m =&gt; m.ProductID))
      &lt;/th&gt;
      &lt;th&gt;
        @Html.DisplayFor(model =&gt; model.Select(m =&gt; m.Name))
      &lt;/th&gt;
      &lt;th&gt;
        @Html.DisplayFor(model =&gt; model.Select(m =&gt; m.ListPrice))
      &lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
    &lt;/tr&gt;
  
  @foreach (var item in Model) {
    &lt;tr&gt;
      &lt;td&gt;
        @Html.DisplayFor(modelItem =&gt; item.ProductID)
      &lt;/td&gt;
      &lt;td&gt;
        @Html.DisplayFor(modelItem =&gt; item.Name)
      &lt;/td&gt;
      &lt;td&gt;
        @Html.DisplayFor(modelItem =&gt; item.ListPrice)
      &lt;/td&gt;
      &lt;td&gt;
        @Html.ActionLink("Edit", "Edit", new { id=item.ProductID }) |
        @Html.ActionLink("Details", "Details", new { id=item.ProductID }) |
        @Html.ActionLink("Delete", "Delete", new { id=item.ProductID })
      &lt;/td&gt;
    &lt;/tr&gt;
  }
  &lt;/table&gt;
  </code></pre>
  
  <p>Do you know what that mean and how to fix it? Thank you so much!</p>