title: entity framework mapping fluent api seperate entity map
body: <p>I'm trying to separate my entity map but when do that no changes applied on DB. Why?</p>
  
  <p>Following is my code :</p>
  
  <pre><code>//class for example 
   class UserMap : EntityTypeConfiguration&lt;User&gt;
  {
      public UserMap()
      {
          this.ToTable("User");
          this.HasKey&lt;int&gt;(p =&gt; p.Id);
          this.Property(u =&gt; u.UserPin).IsRequired().HasMaxLength(2000);
      }
  }
  //my project context
   public class ProjectDbContext : DbContext
  {
      public ProjectDbContext()
          : base("name=DefaultConnectionString")
      {
  
      }
  
      public DbSet&lt;Project&gt; Projects { get; set; }
      public DbSet&lt;Image&gt; Images { get; set; }
      public DbSet&lt;User&gt; Users { get; set; }
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
  //inject my user map rules 
          base.OnModelCreating(modelBuilder);
          modelBuilder.Configurations.Add(new UserMap());
  
      }
  }
  </code></pre>
  
  <p>How to inject my map configuration to apply?</p>