Skip to content
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

Remove building an intermediate service provider at startup #1431

Merged
merged 1 commit into from Dec 22, 2023

Conversation

bkoelman
Copy link
Member

@bkoelman bkoelman commented Dec 21, 2023

This PR removes building an intermediate service provider at startup, which is considered an anti-pattern, leading to occasional compatibility issues.

This unblocks use in Aspire (more specifically, its usage of AddNpgsqlDataSource, which throws an ObjectDisposedException) and fixes #1082.

While AddNpgsqlDataSource (from the Npgsql.DependencyInjection NuGet package) works in a regular API project, it fails in our integration tests (tracked at npgsql/efcore.pg#2542 (comment)).

QUALITY CHECKLIST

  • Changes implemented in code
  • Complies with our contributing guidelines
  • N/A: Adapted tests
  • N/A: Documentation updated

…s considered an anti-pattern, leading to occasional compatibility issues.

This unblocks use in [Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/) (more specifically, its usage of `AddNpgsqlDataSource`, which throws an `ObjectDisposedException`) and fixes #1082.
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (2a30f19) 90.73% compared to head (1ff3ee2) 90.74%.

Files Patch % Lines
...NetCore/Configuration/JsonApiApplicationBuilder.cs 96.87% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1431   +/-   ##
=======================================
  Coverage   90.73%   90.74%           
=======================================
  Files         342      344    +2     
  Lines       10982    11003   +21     
  Branches     1812     1813    +1     
=======================================
+ Hits         9965     9985   +20     
  Misses        669      669           
- Partials      348      349    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bkoelman bkoelman marked this pull request as ready for review December 22, 2023 01:11
@bkoelman bkoelman merged commit 2637d0d into master Dec 22, 2023
16 checks passed
@bkoelman bkoelman deleted the no-intermediate-service-provider branch December 22, 2023 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Can't use Serilog bootstrap logger with JADNC
1 participant