title: Delete Data Api with Table have related another table .net Core
body: <p>I have problem delete data when Tables have related another table, when i tried this code with PostMan, i have error message "Invalid Columname TbRegistryId". in my table TbRegistry i didnt have Column TbRegistryId, but is just Id</p>
  
  <p>Here My Models</p>
  
  <pre><code>public partial class TbRegistry
      {
          public int Id { get; set; }
          public string NoRisk { get; set; }
          public string Bproses { get; set; }
          public string Risiko { get; set; }
          public string AktivitasPengendalian { get; set; }
          public string Peristiwa { get; set; }
          public string PenyebabKrisiko { get; set; }
          public string KategoriRisk { get; set; }
          public string Sop { get; set; }
          public string PemilikRisiko { get; set; }
          public string UnitTerkait { get; set; }
          public string Kontrol { get; set; }
          public string TipeKontrol { get; set; }
          public string JustifikasiImpact { get; set; }
          public string JustifikasiLikelihood { get; set; }
          public string Kri { get; set; }
          public string RencMitiRisk { get; set; }
          public string TargetMitigasi { get; set; }
          public string Narasumber { get; set; }
          public int Status { get; set; }
          public string UserInput { get; set; }
          public DateTime? DateInput { get; set; }
          public string Note { get; set; }
          public int? Flag { get; set; }
          public string Keterangan { get; set; }
          public string KodeUnit { get; set; }
          public DateTime? LastUpdated { get; set; }
          public string UserUpdate { get; set; }
  
          public TbMitigationPlan TbMitigationPlan { get; set; }
          public TbRegistryImpact TbRegistryImpact { get; set; }
          public ICollection&lt;TbMitigationPlan&gt; DataMitigation { get; set; }
      }
  </code></pre>
  
  <p>And Here My Controllers</p>
  
  <pre><code>        public IActionResult DeleteRisk(int id)
          {
              try
              {
                  if (!ModelState.IsValid)
                  {
                      return BadRequest(ModelState);
                  }
  
                   var Risk = _context.TbRegistry.Where(x =&gt; x.Id == id);
                  var Miti = _context.TbMitigationPlan.Where(a =&gt; a.IdRisk == id);
                  var Impact = _context.TbRegistryImpact.Where(b =&gt; b.IdRisk == id);
  
                   if (Risk == null)
                  {
                      return NotFound();
                  }
                  _context.TbMitigationPlan.RemoveRange(Miti);
                  _context.TbRegistryImpact.RemoveRange(Impact);
                  _context.TbRegistry.RemoveRange(Risk);
                  _context.SaveChanges();
  
                  return NoContent();
              }
              catch (Exception ex)
              {
  
                  return BadRequest(ex.Message);
              }
          }
  </code></pre>