title: The navigation property was not found on the dependent type in Entity Framework migration
body: <p>I fixed all the Primary Keys, gave update-database but I have the following error:</p>
  
  <p>I tried to fix it with establishing the foreign keys, but I have a new error:</p>
  
  <blockquote>
    <p>The ForeignKeyAttribute on property 'ID_Model' on type 'Proiect_masini_firma_taxi.Models.Masini' is not valid. The navigation property 'Modele_masini' was not found on the dependent type 'Proiect_masini_firma_taxi.Models.Masini'. The Name value should be a valid navigation property name.</p>
  </blockquote>
  
  <p>Masini.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel.DataAnnotations.Schema;
  using System.ComponentModel.DataAnnotations;
  
  namespace Proiect_masini_firma_taxi.Models
  {
       public enum Da_Sau_Nu
       {
            Da, Nu
       }
  
  public class Masini
  {
      [Key]
      public int ID_Masina { get; set; }
      public string Numar_inmatriculare { get; set; }
      [ForeignKey("Modele_masini")]
      public int ID_Model { get; set; }
      public int An_Fabricatie { get; set; }
      public int ID_proprietar { get; set; }
      public Da_Sau_Nu Disponibilitate { get; set; }
      public Soferi Soferi_masini { get; set; }
      public Ture Ture_masini { get; set; }
      public Modele_masini Masini_modele { get; set; }
  
      internal static void ForEach(Func&lt;object, object&gt; p)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Modele_masini.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel.DataAnnotations.Schema;
  using System.ComponentModel.DataAnnotations;
  
  namespace Proiect_masini_firma_taxi.Models
  {
      public class Modele_masini
      {
          [Key]
          public int ID_model { get; set; }
          public string Nume_model { get; set; }
          public string Descriere_Model { get; set; }
          public ICollection&lt;Masini&gt; Masini_modele { get; set; }
      }
  }
  </code></pre>
  
  <p>Soferi.cs:</p>
  
  <pre><code> using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Web;
   using System.ComponentModel.DataAnnotations.Schema;
   using System.ComponentModel.DataAnnotations;
  
   namespace Proiect_masini_firma_taxi.Models
   {
       public enum DaSauNu
       {
          Da, Nu
      }
  public class Soferi
  {
      [Key]
      public int ID_sofer { get; set; }
      public string Nume { get; set; }
      public string Prenume { get; set; }
      public DateTime Data_nasterii { get; set; }
      public string Serie_permis_de_conducere { get; set; }
      public DateTime Data_Expirarii { get; set; } 
      public DaSauNu Angajat_curent { get; set; }
      public ICollection&lt;Ture&gt; Soferi_ture { get; set; } 
      public ICollection&lt;Masini&gt; Soferi_masini { get; set; }
  
      internal static void ForEach(Func&lt;object, object&gt; p)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Ture.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel.DataAnnotations.Schema;
  using System.ComponentModel.DataAnnotations;
  
  namespace Proiect_masini_firma_taxi.Models
  {
       public class Ture
       {
           [Key]
           public int ID_tura { get; set; }
           [ForeignKey("Soferi")]
           public int ID_sofer { get; set; }
           [ForeignKey("Masini")]
           public int ID_masina { get; set; }
           public DateTime Moment_Start_Tura { get; set; }
           public DateTime Moment_Sfarsit_Tura { get; set; }
           public DateTime Moment_logare { get; set; }
           public DateTime Moment_delogare { get; set; }
           public Ture Ture_Sofer { get; set; }
           public Masini Ture_Masini { get; set; } 
     }
  }
  </code></pre>