DefaultConnectionFactory using MSSQL

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
tchadwick
Posts: 3
Joined: Wed 10 Feb 2021 19:40

DefaultConnectionFactory using MSSQL

Post by tchadwick » Wed 10 Feb 2021 19:45

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!

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: DefaultConnectionFactory using MSSQL

Post by Shalex » Thu 11 Feb 2021 16:34

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.

tchadwick
Posts: 3
Joined: Wed 10 Feb 2021 19:40

Re: DefaultConnectionFactory using MSSQL

Post by tchadwick » Wed 17 Feb 2021 23:12

Thanks, that worked!

Post Reply