title: Entity Framework "The member [...] does not exist in the metadata collection
body: <p>I got my different projects working and had to change a small thing in a model which forced me to drop my tables and re-create them. After a long period of researching I found out that I have to use Initializers (DropCreateDatabaseAlways). Additionally I created some custom Initializers to Seed my Database with Test data. Now every time I run my application I receive the following exception:</p>
  
  <blockquote>
    <p>The member with identity 'SGDB.DAL.Contexts.Person_Department' does
    not exist in the metadata collection. Parameter name: identity.</p>
  </blockquote>
  
  <p>Before I changed my model (has nothing to do with the relationship between Person and Department) everything worked fine. Additionally the identifiers of all my models are named Id (as EF expects) and are decorated with the [Key] attribute.</p>
  
  <p>Yea, I already read other threads about this topic but the solution there was to create a Id Property for every foreign key (in my case DepartmentId in Person.cs) but I don't like that - especially because I know it worked before.</p>
  
  <p>What could be the cause?</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>I'm trying to seed new Persons as following:</p>
  
  <pre><code>protected override void Seed(PersonContext context) {
          base.Seed(context);
          var dep = new DAL.Contexts.DepartmentContext().Departments.First();
  
          var status = new Status {
              StatusType = "Test"
          };
  
          var persondata = new PersonData {
              Status = status
          };
          context.Status.Add(status);
          context.PersonData.Add(persondata);
          for (int i = 0; i &lt; 10; i++) {
              var person = new Person {
                  Firstname = $"TestPersonFirstname{i}",
                  Lastname = $"TestPersonLastname{i}",
                  SourceType = COM.SourceType.Manual,
                  Department = dep,
                  PersonData = persondata
              };
          context.Persons.Add(person);
          }
  
  
          context.SaveChanges();
  
      }
  </code></pre>