title: how to fix duplicate Displayed records in table in ASP.NET Core MVC?
body: <p>I'm trying to display records to View but it shows duplicate records. I try to debug in the Controller, the records are correctly retrieved from the database no prob The problem is in the Views.</p>
  
  <pre><code>&lt;tbody&gt;
                  @if (Model == null)
                  {
                      &lt;tr&gt;
                          &lt;td colspan="7" class="text-center"&gt;No Model Data&lt;/td&gt;
                      &lt;/tr&gt;
                  }
                  else
                  {
                      @foreach (var list in Model)
                      {
                          &lt;tr&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.EmployeeID)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.EmployeeName)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.Address)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.Email)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.ContactNo)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.Gender)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.Birthday)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.Status)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.Position)&lt;/td&gt;
                          &lt;td&gt;@Html.DisplayFor(Model =&gt; list.Department)&lt;/td&gt;
                          &lt;td&gt;
                              &lt;button class="btn-default" asp-action="Update" asp-route-id="@list.EmployeeID"&gt;Edit&lt;/button&gt;
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;form asp-action="Delete" method="post" asp-route-id="@list.EmployeeID"&gt;
                                  &lt;button class="btn-danger"&gt;Delete&lt;/button&gt;
                              &lt;/form&gt;
                          &lt;/td&gt;
                          &lt;/tr&gt;
                      }
                  }
                  &lt;/tbody&gt;
  </code></pre>