Entity Framework Core 1 (Entity Framework 7) Support

April 25th, 2016

Entity Framework Core 1, formerly known as Entity Framework 7 (hereafter also called EF Core or EF7), is supported in Devart ADO.NET provider product line. It is supported in providers for relational databases: Oracle, MySQL, PostgreSQL, SQLite, DB2, and provides for cloud data sources, such as Salesforce, Dynamics CRM, SugarCRM, Zoho CRM, QuickBooks, FreshBooks, MailChimp, ExactTarget, Bigcommerce, Magento. Currently our providers support Entity Framework Core Release Candidate 1. Entity Framework Core support is currently in public beta stage. It is implemented for the full .NET Framework platform – .NET Framework 4.5.1 and higher.

We need to mention first that Entity Framework Core 1 (Entity Framework 7) – is a completely new ORM, which inherited only the name, LINQ support, and some classes with the same or similar names from Entity Framework 6, and even these classes often have incomplete functionality in comparison to their Entity Framework 6 counterparts. You can find more information about EF Core compatibility with EF6 and issues of migration in other our article, “Migrating Entity Framework 6 projects to Entity Framework Core 1 (Entity Framework 7)”. Additionally you can study Entity Framework Core features in its official documentation.

New Assemblies and Provider Registration

For Entity Framework Core, a new assembly is added to our providers, and it should be deployed with applications, using Entity Framework Core.

Additionally, we have included new new extension methods for provider registration and specifying a connection string to our Entity Framework providers for EF Core (EF7).

The new assemblies and extension methods are listed in the following table:

Provider Assembly Registration method name
Devart dotConnect for Oracle Devart.Data.Oracle.Entity.EF7.dll UseOracle()
Devart dotConnect for MySQL Devart.Data.MySql.Entity.EF7.dll UseMySql()
Devart dotConnect for PostgreSQL Devart.Data.PostgreSql.Entity.EF7.dll UsePostgreSql()
Devart dotConnect for SQLite Devart.Data.SQLite.Entity.EF7.dll UseSQLite()
Devart dotConnect for DB2 Devart.Data.DB2.Entity.EF7.dll UseDB2()
Devart dotConnect for Salesforce Devart.Data.Salesforce.Entity.EF7.dll UseSalesforce()
Devart dotConnect for Dynamics CRM Devart.Data.Dynamics.Entity.EF7.dll UseDynamics()
Devart dotConnect for SugarCRM Devart.Data.Sugar.Entity.EF7.dll UseSugar()
Devart dotConnect for Zoho CRM Devart.Data.Zoho.Entity.EF7.dll UseZoho()
Devart dotConnect for QuickBooks Devart.Data.QuickBooks.Entity.EF7.dll UseQuickBooks()
Devart dotConnect for FreshBooks Devart.Data.FreshBooks.Entity.EF7.dll UseFreshBooks()
Devart dotConnect for MailChimp Devart.Data.MailChimp.Entity.EF7.dll UseMailChimp()
Devart dotConnect for ExactTarget Devart.Data.ExactTarget.Entity.EF7.dll UseExactTarget()
Devart dotConnect for Bigcommerce Devart.Data.Bigcommerce.Entity.EF7.dll UseBigcommerce()
Devart dotConnect for Magento Devart.Data.Magento.Entity.EF7.dll UseMagento()

In order to register an Entity Framework provider and set a connection string, you need to override the OnConfiguring method of your DbContext class descendant.
Example for Devart dotConnect for Oracle:


The mapping supported by Entity Framework Core is described in details in the corresponding section of Entity Framework documentation.

If you plan to support several data sources for one base Entity Framework model, that is mapped to tables and columns named differently in different data sources, you can use special provider-specific extension methods in fluent mapping in order to support specific mapping for each data source simultaneously:

Provider Table name Column name Column type
Еxtension method not related to a specific provider ToTable() HasColumnName() HasColumnType()
Еxtension method for SQL Server ForSqlServerToTable() ForSqlServerHasColumnName() ForSqlServerHasColumnType()
dotConnect for Oracle ForOracleToTable() ForOracleHasColumnName() ForOracleHasColumnType()
dotConnect for MySQL ForMySqlToTable() ForMySqlHasColumnName() ForMySqlHasColumnType()
dotConnect for PostgreSQL ForPostgreSqlToTable() ForPostgreSqlHasColumnName() ForPostgreSqlHasColumnType()
dotConnect for SQLite ForSQLiteToTable() ForSQLiteHasColumnName() ForSQLiteHasColumnType()
dotConnect for DB2 ForDB2ToTable() ForDB2HasColumnName() ForDB2HasColumnType()
dotConnect for Salesforce ForSalesforceToTable() ForSalesforceHasColumnName() ForSalesforceHasColumnType()
dotConnect for Dynamics CRM ForDynamicsToTable() ForDynamicsHasColumnName() ForDynamicsHasColumnType()
dotConnect for SugarCRM ForSugarToTable() ForSugarHasColumnName() ForSugarHasColumnType()
dotConnect for Zoho CRM ForZohoToTable() ForZohoHasColumnName() ForZohoHasColumnType()
dotConnect for QuickBooks ForQuickBooksToTable() ForQuickBooksHasColumnName() ForQuickBooksHasColumnType()
dotConnect for FreshBooks ForFreshBooksToTable() ForFreshBooksHasColumnName() ForFreshBooksHasColumnType()
dotConnect for MailChimp ForMailChimpToTable() ForMailChimpHasColumnName() ForMailChimpHasColumnType()
dotConnect for ExactTarget ForExactTargetToTable() ForExactTargetHasColumnName() ForExactTargetHasColumnType()
dotConnect for Bigcommerce ForBigcommerceToTable() ForBigcommerceHasColumnName() ForBigcommerceHasColumnType()
dotConnect for Magento ForMagentoToTable() ForMagentoHasColumnName() ForMagentoHasColumnType()

There are also similar extension methods for specific mapping for each data source simultaneously:

  • For{DataSourceName}HasName() – specifies the name of the index and primary key
  • For{DataSourceName}HasConstraintName() – specifies the foreign key name
  • For{DataSourceName}HasDefaultValueSql() – specifies the default column value

For example, for dotConnect for Oracle, these methods would be:

  • ForOracleHasName()
  • ForOracleHasConstraintName()
  • ForOracleHasDefaultValueSql()

And for other providers there are also such methods named respectively.

The following example demonstrates mapping an Account class to various tables depending on the data source:

Current Limitations

When applying this solution to production, you should consider that our Entity Framework Core support is still at beta stage, and Entity Framework Core has not yet reached the release stage too.

Our support is implemented only for the Full .NET Framework platform of version 4.5.1 and higher. We also considering the possibility of implementation for .NET Core and Universal Windows Platform, but there are no release dates scheduled.

Additionally, our providers support only a part of provider configuration settings. For example, for config.DatabaseScript.Schema.DeleteDatabaseBehaviour setting, only the DeleteDatabaseBehaviour.ModelObjectsOnly value (default value) is supported.

Some of the features present in EF6 providers are also not supported in EF Core providers because Entity Framework Core itself does not support many of Entity Framework 6 features. For example, these features include spatials or stored procedure support, etc. You can find more information about not supported features in another our blog article, “Migration of Entity Framework 6 projects to Entity Framework Core 1 (Entity Framework 7)”.

Behavior Changes

Some provider configuration settings changed their default value. For example, config.CodeFirstOptions.TruncateLongDefaultNames is now true by default, though it was false before. This change was made in order to eliminate or decrease the need to configure the provider in simple cases. Entity Framework often generates too long name for foreign keys, and user often had to set this option to true in order to perform dynamic database object generation, especially for Oracle, where there is the 30 character limit on the names. MySQL and PostgreSQL allow longer names, but sometimes users encounter such situation with them too.

There are some other changes in other aspects in comparison too Entity Framework 6, but these changes were made because we are trying to implement all the features of Entity Framework 6 we can with completely new EF Core engine. Some aspects are not yet implemented, but we are working hard to make behavior as similar as possible.

Database-First and Model-First in Entity Framework Core

Model-First approach is not supported in Entity Framework Core and there are no visual designer for Entity Framework Core models.

Database-First is supported via Package Manager Console. It is console-mode and very feature-limited. We have not yet implemented support for this functionality.

We plan to release a new version of a visual ORM model designer for Entity Framework – Devart Entity Developer. The new version will provide full implementation of the Database First and Model First approaches for Entity Framework Core. Devart Entity Developer has a wide feature set, advanced “Update From Database” support, generates code of entities, DbContext, and fluent mapping for them, and implements lots of other features.

Creating Simple Code-First Entity Framework Core Application

Let’s create a simple Code-First application that will create tables in the database based on the model in run-time, fill them with sample data, and execute queries.

Note that dynamic database object creation (tables/FK/PK/indexes/triggers/sequences) based on an Entity Framework model is implemented in Devart Entity Framework providers only for relational databases: Oracle, MySQL, PostgreSQL, SQLite and DB2.


  • You must have Visual Studio 2013 or Visual Studio 2015 installed.
  • Install at least one of the Devart ADO.NET providers that support EF Core (EF7) and dynamic database object creation.

To create the sample application, let’s perform the following steps:

  1. Create a new console application.
  2. Ensure you are targeting .NET Framework 4.5.1 or later.
  3. Install the Entity Framework Core NuGet package by executing the following command in the Package Manager Console:
  4. Add our provider-specific assemblies to the project references:
    • dotConnect common assembly – Devart.Data.dll
    • Provider-specific assembly Devart.Data.{DataSourceName}.dll: for Oracle it would be Devart.Data.Oracle.dll, for MySQL – Devart.Data.MySql.dll, and so on.
    • EF7 provider assembly Devart.Data.{DataSourceName}.Entity.EF7.dll: for Oracle it would be Devart.Data.Oracle.Entity.EF7.dll, for MySQL – Devart.Data.MySql.Entity.EF7.dll, and so on.

    Note that when using one of our providers for cloud applications, you would also need to add a reference to Devart.Data.SqlShim.dll – common assembly of Devart ADO.NET providers for cloud applications. However, this our example uses only dotConnect providers for relational databases.

  5. Create a DbContext descendant.

  6. Register Entity Framework Core provider for using with our DbContext and specify the connection string. For this override the OnConfiguring method. Example for Devart dotConnect for Oracle:

  7. Create entity classes, used in the model. If necessary, set DataAnnotation attributes for the classes and properties.

  8. Add our classes to the DbContext descendant as DbSet properties. If necessary, you can also write fluent mapping, by overriding the OnModelCreating method.

  9. Now let’s choose how to create the database. We can generate Code-First Migrations. Or, for test purposes, we can implement the analogue of Entity Framework 6 initialization strategy DropCreateDatabaseAlways.

  10. Now let’s add code that creates the context, re-creates the database, fills it with the test data, and executes LINQ to Entities queries.

  11. Now we can run the application. It will create tables in the database, fill them with data, execute a query and output its results to the console:

The attached archive contains a more complete application version with one Entity Framework model with several implementations for SQL Server, Oracle, MySQL, PostgreSQL, SQLite and DB2. The project also enables monitoring of the database calls via the free Devart DbMonitor tool.

Open the solution in Visual Studio, select a project for the installed provider and set it as Startup Project. Modify the connection string in the app.config file of the project, and after this, you can start it. You can also start Devart DbMonitor, and it will display the log of all the database interactions: connection opening/closing, transactions, DDL and DML statements, etc.


We are glad to provide the new Entity Framework provider functionality – support for Entity Framework Core (Entity Framework 7) – to our users. We hope that application development will be smooth and trouble-free for users who decide to try it. Anyway, we are always ready to improve our Entity Framework providers to help our users if they have any troubles and these troubles can be solved within Entity the scope of Framework Core functionality. As for our plans for the future of Entity Framework Core providers, they will be determined and changed according to your feedback, which you can send via the feedback page of the corresponding providers our forum, and UserVoice.

6 Responses to “Entity Framework Core 1 (Entity Framework 7) Support”

  1. Tathagata Says:

    What If I want to return Raw SQL or just call a procedure using the new FromSql() of EF Core without any migration ? I found that for some unknown reason that is not working.

  2. Michael Says:

    The third paragraph from the bottom mentions an “attached archive” which contains a ” complete application.”

    I can’t find the link on this page.


  3. Byung-Huyn Nah Says:

    It is supported in ASP.NET Core 2.0 ??

  4. Gustavo Cruz Says:

    Any plans to release support for EF core 2?

  5. Shalex Says:

    Current builds of dotConnect providers support .NET Core 2.1 / EF Core 2.1.

  6. Shalex Says:

    Current builds of dotConnect providers support .NET Core 2.1 / EF Core 2.1.

Leave a Comment