Page 1 of 1

DefaultConnectionFactory using MSSQL

Posted: Wed 10 Feb 2021 19:45
by tchadwick
Hello All,
I'm hoping someone here can help me, I'm just getting started and I'm running into an issue where using a connection string on the fly is using the SQL client's Connection Factory. In my DbConfiguration I have a line that works using the NgPsql library, but I can't seem to find the Devart equivalent:

SetProviderFactory("Devart.Data.PostgreSql", Devart.Data.PostgreSql.PgSqlProviderFactory.Instance);
SetProviderServices("Devart.Data.PostgreSql", Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices.Instance);
SetDefaultConnectionFactory(new NpgsqlConnectionFactory()); // ???? What is the Devart Equivalent?

Hope you can help!

Re: DefaultConnectionFactory using MSSQL

Posted: Thu 11 Feb 2021 16:34
by Shalex
tchadwick wrote: Wed 10 Feb 2021 19:45 SetDefaultConnectionFactory(new NpgsqlConnectionFactory()); // ???? What is the Devart Equivalent?
Here is an implementation of the NpgsqlConnectionFactory class: https://github.com/npgsql/EntityFramewo ... Factory.cs. It does nothing, only returns the connection instance.

Please do not set SetDefaultConnectionFactory(...) with dotConnect for PostgreSQL, and Entity Framework will create the connection object using the specified connection string.

Re: DefaultConnectionFactory using MSSQL

Posted: Wed 17 Feb 2021 23:12
by tchadwick
Thanks, that worked!