title: The INSERT statement conflicted with the FOREIGN KEY constraint in Entity Framework Core
body: <p>I'm using Entity Framework 7 RC1, I have these entities:</p>
  
  <pre><code>public class Book
  {
      [Key]
      public string BookId { get; set; }
      public List&lt;BookPage&gt; Pages { get; set; }
      public Author Author { get; set; }
      public string Text { get; set; }
  } 
  
  public class BookPage
  {
      [Key]
      public string BookPageId { get; set; }
      public int Number { get; set; }
  }
  
  public class Author
  {
      [Key]
      public string AuthorId { get; set; }
      public string FullName { get; set; }
  }
  </code></pre>
  
  <p><em>ApplicationDbContext.cs</em> is default, with <code>public DbSet&lt;Book&gt; Books { get; set; }</code></p>
  
  <p>When I'm trying to insert new Book, like this</p>
  
  <pre><code>var book = new Book()
  {
      BookId = Guid.NewGuid().ToString(),
      Pages = new List&lt;BookPage&gt;()
      {
          new BookPage()
          {
              BookPageId = Guid.NewGuid().ToString(),
              Number = 1
          }
      },
      Author = new Author()
      {
          AuthorId = Guid.NewGuid().ToString(),
          FullName = "Forexample"
      },
      Text = "new book"
  };
  dbContext.Books.Add(book);
  dbContext.SaveChanges();
  </code></pre>
  
  <p>It throws exception:</p>
  
  <blockquote>
    <p>SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Book_Author_AuthorAuthorId". </p>
  </blockquote>
  
  <p>What's the problem with this simple insert? I don't want manually add BookPage and Author, it's Entity Framework job.</p>