title: How to use the Abp.ZeroCore.EntityFramework with a ASP.NET Core solution
body: <p>
  I am trying to use the package <code>Abp.ZeroCore.EntityFramework</code> in a vanilla ASP.NET Boilerplate template project, targeting ASP.NET Core 2 with full .NET Framework.
  The template includes Entity Framework Core, but I want to use Entity Framework 6 because it's much more reliable and has features Entity Framework Core is missing.</p>
  
  <p>In order to get it to build, I created a classic .NET class library with the <code>Abp.ZeroCore.EntityFramework</code> package, replicating the original .EntityFrameworkCore project included in the project template, but with code specific to EntityFramework 6, and configured all other projects to use this new module instead of the EF Core project.</p>
  
  <p>Project builds successfully without any warnings, but when I try to create a migration I get a model validation error detailed below:</p>
  
  
  
  <pre><code>PM&gt; Add-Migration InitialMigration
  System.InvalidOperationException: The index with name 'IX_UserId_State_CreationTime' on table 'dbo.AbpUserNotifications' has the same column order of '1' specified for columns 'TenantId' and 'UserId'. Make sure a different order value is used for the IndexAttribute on each column of a multi-column index.
     at System.Data.Entity.Infrastructure.ConsolidatedIndex.Add(String columnName, IndexAttribute index)
     at System.Data.Entity.Infrastructure.ConsolidatedIndex.BuildIndexes(String tableName, IEnumerable`1 columns)
     at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.&lt;FindTargetIndexes&gt;b__278(EntitySet es)
     at System.Linq.Enumerable.&lt;SelectManyIterator&gt;d__22`3.MoveNext()
     at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
     at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
     at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(ModelMetadata source, ModelMetadata target, Lazy`1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion)
     at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, Lazy`1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion)
     at System.Data.Entity.Migrations.DbMigrator.Scaffold(String migrationName, String namespace, Boolean ignoreChanges)
     at System.Data.Entity.Migrations.Design.MigrationScaffolder.Scaffold(String migrationName, Boolean ignoreChanges)
     at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.Scaffold(MigrationScaffolder scaffolder)
     at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.RunCore()
     at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()
  The index with name 'IX_UserId_State_CreationTime' on table 'dbo.AbpUserNotifications' has the same column order of '1' specified for columns 'TenantId' and 'UserId'. Make sure a different order value is used for the IndexAttribute on each column of a multi-column index.
  </code></pre>
  
  <p>
  So it looks like that some of the included models in Abp.ZeroCore package are not compatible with the Abp.ZeroCore.EntityFramework package.</p>
  
  <p>Is this a know issue or there is a workaround for this error?
  Including a vanilla ASP.NET Boilerplate template using ASP.NET Core and Entity Framework 6 would be really useful.
  </p>