How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
tommyiraone
Posts: 9
Joined: Thu 13 Dec 2018 07:25

How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension

Post by tommyiraone » Thu 13 Dec 2018 07:36

I used to use this code using Npgsql
new DbContextOptionsBuilder().UseNpgsql(_arg_connection).Options;

but i cannot get the .Options using UsePostgreSql extension.
DbContextOptionsBuilder().UsePostgreSql(_arg_connection);

How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension ?

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

Re: How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension

Post by Shalex » Fri 14 Dec 2018 09:34

The .UsePostgreSql() extension method is defined in Devart.Data.PostgreSql.Entity.EFCore.dll:

* .NET Standard (.NET Core) version of this assembly is included into the package https://www.nuget.org/packages/devart.d ... sql.efcore

* .NET Framework version is created by the installation at C:\Program Files (x86)\Devart\dotConnect\PostgreSQL\Entity\EFCore2\Devart.Data.PostgreSql.Entity.EFCore.dll

tommyiraone
Posts: 9
Joined: Thu 13 Dec 2018 07:25

Re: How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension

Post by tommyiraone » Fri 14 Dec 2018 12:50

The .UsePostgreSql() is not the problem.

the problem is there is no .Options property after .UsePostgreSql() method.

if i use Npgsql
DbContextOptions _option = new DbContextOptionsBuilder().UseNpgsql(_connection).Options;

if i use SqlServer
DbContextOptions _option = new DbContextOptionsBuilder().UseSqlServer(_connection).Options;

but if use dotConnect for PostgreSQL.. there is no .Options.
PgsqlDbContextOptionsBuilder does not contain definition for 'Options'...

tommyiraone
Posts: 9
Joined: Thu 13 Dec 2018 07:25

Re: How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension

Post by tommyiraone » Sun 16 Dec 2018 22:51

how can I get support more faster? I already have a license... i need this asap.. this is to slow....

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

Re: How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension

Post by Shalex » Mon 17 Dec 2018 20:29

tommyiraone wrote: Sun 16 Dec 2018 22:51there is no .Options property after .UsePostgreSql() method
1. We will investigate the question and notify you about the result. As a current solution, you can get the same functionality via DbContextOptionsBuilder.Options.
For example:

Code: Select all

  var builder = new DbContextOptionsBuilder<postgresModel>();
  builder.UsePostgreSql(@"...");
  builder.Options...
tommyiraone wrote: Sun 16 Dec 2018 22:51how can I get support faster?
2. Our support has a two business day response policy: https://www.devart.com/dotconnect/postg ... pport.html. But we do our best to respond as soon as possible.


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

Re: How do i get DbContextOptions From DbContextOptionsBuilder().UsePostgreSql extension

Post by Shalex » Fri 25 Oct 2019 18:37

Entity Framework Core 3.0 is supported in dotConnect for PostgreSQL v7.15.1499: viewtopic.php?f=3&t=39477.

In EF Core 3.0, UsePostgreSql() returns DbContextOptionsBuilder that has Options.

Post Reply