title: HasOne not found in EF 6
body: <p>I am very new to Entity Framework and I am trying to figure out relations. I have found this code:</p>
  
  <pre><code>class MyContext : DbContext
  {
      public DbSet&lt;Post&gt; Posts { get; set; }
      public DbSet&lt;Tag&gt; Tags { get; set; }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          modelBuilder.Entity&lt;PostTag&gt;()
              .HasKey(t =&gt; new { t.PostId, t.TagId });
  
          modelBuilder.Entity&lt;PostTag&gt;()
              .HasOne(pt =&gt; pt.Post)
              .WithMany(p =&gt; p.PostTags)
              .HasForeignKey(pt =&gt; pt.PostId);
  
          modelBuilder.Entity&lt;PostTag&gt;()
              .HasOne(pt =&gt; pt.Tag)
              .WithMany(t =&gt; t.PostTags)
              .HasForeignKey(pt =&gt; pt.TagId);
      }
  }
  
  public class Post
  {
      public int PostId { get; set; }
      public string Title { get; set; }
      public string Content { get; set; }
  
      public List&lt;PostTag&gt; PostTags { get; set; }
  }
  
  public class Tag
  {
      public string TagId { get; set; }
  
      public List&lt;PostTag&gt; PostTags { get; set; }
  }
  
  public class PostTag
  {
      public int PostId { get; set; }
      public Post Post { get; set; }
  
      public string TagId { get; set; }
      public Tag Tag { get; set; }
  }
  </code></pre>
  
  <p>I get an error while compiling the code:</p>
  
  <blockquote>
    <p>'EntityTypeConfiguration' does not contain a definition for
    'HasOne' and no extension method 'HasOne' accepting a first argument
    of type 'EntityTypeConfiguration' could be found (are you
    missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>I have tried to find it on Google and StackOverflow, but the only things I found was how to use it and not why it gives problems. Do I actually miss a reference? If so, which one?</p>