title: Migrating from Entity Framework to Entity Framework Core: OnModelCreating
body: <p>I'm still trying to migrate my wpf application from entity framework to entity framework core I am using the code first but I'm getting some issues; I need your help, please:</p>
  
  <pre><code>protected override void OnModelCreating(ModelBuilder modelBuilder)
  {
      modelBuilder.Entity&lt;Script&gt;().Property(x =&gt; x.Code).IsMaxLength();
      modelBuilder.Entity&lt;CalculationSelector&gt;().HasMany(x =&gt; x.CalculationTypes).WithMany();
      modelBuilder.Entity&lt;WarehouseConsumption&gt;().Property(p =&gt; p.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
      modelBuilder.Entity&lt;PeriodicConsumption&gt;().HasMany(p =&gt; p.WarehouseConsumptions).WithRequired().HasForeignKey(x =&gt; x.PeriodicConsumptionId);
      modelBuilder.Entity&lt;CalculationType&gt;().Property(x =&gt; x.Amount).HasPrecision(precision, scale);
      modelBuilder.Entity&lt;Numerator&gt;().Property(x =&gt; x.LastUpdateTime).IsConcurrencyToken().HasColumnType("timestamp");
  }
  </code></pre>
  
  <p>First of all, I'm getting an error in the IsMaxLength() function; In this case I can use MaxLength() and the value must be between the parentheses?</p>
  
  <blockquote>
    <p>CS1061 'PropertyBuilder' does not contain a definition for 'IsMaxLength' and no accessible extension method 'IsMaxLength' accepting a first argument of type 'PropertyBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>Then I get an error in the HasMany()-WithMany() combination; There is no support for many-to-many relationships in the Entity Framework Core?</p>
  
  <blockquote>
    <p>'CollectionNavigationBuilder' does not contain a definition for 'WithMany' and no accessible extension method 'WithMany' accepting a first argument of type 'CollectionNavigationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>I also have errors in the functions HasDatabaseGeneratedOption(), WithRequired(), HasPrecision(), HasColumnType().</p>
  
  <p>Help please, what can I do in each case, I am a newbie </p>