Skip to content

Add warning for data source gotcha in NetTopologySuite docs #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conceptual/EFCore.PG/mapping/nts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ To use the NetTopologySuite plugin, add the [Npgsql.EntityFrameworkCore.PostgreS

### [NpgsqlDataSource](#tab/with-datasource)

> [!WARNING]
> Ensure you build your data source `dataSourceBuilder.Build();` _outside_ of the `AddDbContext()`` configure callback otherwise a new ServiceProvider will be created for each DbContext instance

Since version 7.0, NpgsqlDataSource is the recommended way to use Npgsql. When using NpsgqlDataSource, NetTopologySuite currently has to be configured twice - once at the EF level, and once at the underlying ADO.NET level (there are plans to improve this):

```c#
Expand Down