title: The expression is invalid inside an 'Include' operation, since it does not represent a property access:
body: <p>Controller:</p>
  <pre><code>[HttpGet]
      [Route(&quot;MIDKalorimetar/Delete/{Id}/{Id2}/{Id3}/{Id4}/{Id5}&quot;)]
      public async Task&lt;IActionResult&gt; Delete(DeleteKalorimetarVM modelVM)
      {
          var model = await _db.ParametriMjerila.Where(x =&gt; x.Id == modelVM.Id).Include(d =&gt; d.Id == modelVM.Id2).Include(x=&gt;x.Id == modelVM.Id3).Include(x =&gt; x.Id == modelVM.Id4).Include(x =&gt; x.Id == modelVM.Id5).FirstOrDefaultAsync();
              
          return PartialView(&quot;Delete&quot;, model);
      }
  
  [HttpPost]
  public async Task&lt;IActionResult&gt; Delete(ParametarMjerila parametrniMjerila)
  {
      var model = await _db.ParametriMjerila.Where(x =&gt; x.Id == parametrniMjerila.Id).FirstOrDefaultAsync();
       _db.ParametriMjerila.Remove(model);
       _db.SaveChanges();
  
      return RedirectToAction(&quot;Index&quot;, model);
  }
  </code></pre>
  <p>Button in Index for modal:</p>
  <pre><code>&lt;button class=&quot;bg-transparent border-0&quot; style=&quot; background: transparent; border: 0; border: 0 !important; &quot; data-toggle=&quot;ajax-modal&quot; data-url=&quot;@Url.Action($&quot;Delete/{@Model.Qi.ElementAtOrDefault(x)?.Id}/{@Model.Qp.ElementAtOrDefault(x)?.Id}/{@Model.Qs.ElementAtOrDefault(x)?.Id}/{@Model.R.ElementAtOrDefault(x)?.Id}/{@Model.SP.ElementAtOrDefault(x)?.Id}&quot;)&quot;&gt;
  </code></pre>
  <p>Delete modal:</p>
  <pre><code> @model VerifikacijaMjerila.ViewModels.MIDKalorimetar.DeleteKalorimetarVM
  
  &lt;div class=&quot;modal fade&quot; id=&quot;exampleModal&quot; tabindex=&quot;-1&quot; aria-labelledby=&quot;exampleModalLabel&quot; aria-hidden=&quot;true&quot;&gt;
      &lt;div class=&quot;modal-dialog modal-dialog-centered&quot;&gt;
          &lt;div class=&quot;modal-content&quot;&gt;
              &lt;div class=&quot;modal-header&quot;&gt;
                  &lt;h5 class=&quot;modal-title&quot; id=&quot;exampleModalLabel&quot;&gt;Obriši&lt;/h5&gt;
                  &lt;button type=&quot;button&quot; class=&quot;btn-close&quot; data-bs-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class=&quot;modal-body&quot;&gt;
              &lt;form action=&quot;/MIDKalorimetar/Delete&quot; method=&quot;post&quot; id=&quot;forma&quot;&gt;
              
               
             
              &lt;input asp-for=&quot;Id&quot; hidden/&gt;
              &lt;div class=&quot;d-flex mb-2&quot;&gt;
              &lt;div class=&quot;d-table &quot;&gt;&lt;label class=&quot;d-table-cell align-middle&quot; style=&quot;font-weight:bold&quot;&gt;Vrijednost karakteristike :&lt;/label&gt;&lt;/div&gt;
              &lt;p&gt;@Model.VrijednostKarakteristike&lt;/p&gt;
              &lt;/div&gt;
              &lt;input asp-for=&quot;Id2&quot; hidden/&gt;
              &lt;div class=&quot;d-flex mb-2&quot;&gt;
              &lt;div class=&quot;d-table &quot;&gt;&lt;label class=&quot;d-table-cell align-middle&quot; style=&quot;font-weight:bold&quot;&gt;Vrijednost karakteristike :&lt;/label&gt;&lt;/div&gt;
              &lt;p&gt;@Model.VrijednostKarakteristike&lt;/p&gt;
              &lt;/div&gt;
              &lt;input asp-for=&quot;Id3&quot; hidden/&gt;
              &lt;div class=&quot;d-flex mb-2&quot;&gt;
              &lt;div class=&quot;d-table &quot;&gt;&lt;label class=&quot;d-table-cell align-middle&quot; style=&quot;font-weight:bold&quot;&gt;Vrijednost karakteristike :&lt;/label&gt;&lt;/div&gt;
              &lt;p&gt;@Model.VrijednostKarakteristike&lt;/p&gt;
              &lt;/div&gt;
              &lt;input asp-for=&quot;Id4&quot; hidden/&gt;
              &lt;div class=&quot;d-flex mb-2&quot;&gt;
              &lt;div class=&quot;d-table &quot;&gt;&lt;label class=&quot;d-table-cell align-middle&quot; style=&quot;font-weight:bold&quot;&gt;Vrijednost karakteristike :&lt;/label&gt;&lt;/div&gt;
              &lt;p&gt;@Model.VrijednostKarakteristike&lt;/p&gt;
              &lt;/div&gt;
              &lt;input asp-for=&quot;Id5&quot; hidden/&gt;
              &lt;div class=&quot;d-flex mb-2&quot;&gt;
              &lt;div class=&quot;d-table &quot;&gt;&lt;label class=&quot;d-table-cell align-middle&quot; style=&quot;font-weight:bold&quot;&gt;Vrijednost karakteristike :&lt;/label&gt;&lt;/div&gt;
              &lt;p&gt;@Model.VrijednostKarakteristike&lt;/p&gt;
              &lt;/div&gt;
     
              &lt;/form&gt;
              &lt;/div&gt;
              &lt;div class=&quot;modal-footer&quot;&gt;
                  &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary red&quot; form=&quot;forma&quot; data-save=&quot;modal&quot;&gt;Obriši&lt;/button&gt;
                  &lt;a href=&quot;/MIDKalorimetar/Index1&quot; class=&quot;btn btn-warning&quot;&gt;Nazad&lt;/a&gt;
              &lt;/div&gt;
             
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>So am trying to display this IDs to modal, when I debbug I can see that IDs are passed to controller but it wont open delete modal and the following error appears:</p>
  <blockquote>
  <p>InvalidOperationException: The expression '(d.Id == __modelVM_Id2_1)' is invalid inside an 'Include' operation, since it does not represent a property access: 't =&gt; t.MyProperty'. To target navigations declared on derived types, use casting ('t =&gt; ((Derived)t).MyProperty') or the 'as' operator ('t =&gt; (t as Derived).MyProperty'). Collection navigation access can be filtered by composing Where, OrderBy(Descending), ThenBy(Descending), Skip or Take operations. For more information on including related data, see <a href="http://go.microsoft.com/fwlink/?LinkID=746393" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkID=746393</a>.</p>
  </blockquote>