Support forum for ASP.NET Zero (
By cangunaydin
#16841 Hello i am trying to implement mysql db using devart dotconnect provider.
Since Mysql native connector brings up lots of problems with eager load i wanted to switch to another connector.
Normally in their documentation they are not using defaultconnectionfactory instead of that they are using DbProviderFactories you can find the getting started doc from here: ... force.html

when i have changed my dbconfiguration class according to the post i am getting an error from .net core cli when i try to add a migration. It is saying "keyword not supported for 'port'". It seems like it is still trying to use ms sql connection factory. Do you have any idea what can be the cause of the problem or what am i doing wrong? Thank you.

here is my dbconfiguration class and configuration constructor.

Code: Select all    public class BookAndAdDbConfiguration : DbConfiguration
        public BookAndAdDbConfiguration()
            //Mysql Implementation
            //SetProviderServices("MySql.Data.MySqlClient", new MySqlProviderServices());
            //SetDefaultConnectionFactory(new MySqlConnectionFactory());

            SetProviderServices("Devart.Data.MySql", Devart.Data.MySql.Entity.MySqlEntityProviderServices.Instance);
            SetProviderFactory("Devart.Data.MySql", Devart.Data.MySql.MySqlProviderFactory.Instance);
            //    "System.Data.SqlClient",
            //    System.Data.Entity.SqlServer.SqlProviderServices.Instance

Code: Select all public Configuration()
            //SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());
            SetSqlGenerator(MySqlConnectionInfo.InvariantName, new Devart.Data.MySql.Entity.Migrations.MySqlEntityMigrationSqlGenerator());
            AutomaticMigrationsEnabled = false;
            ContextKey = "BookAndAd";