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

npgsql ef integration doesn't provide a callback that accepts an IServiceProvider #7016

Open
1 task done
aaronpowell opened this issue Jan 3, 2025 · 1 comment · May be fixed by #7017
Open
1 task done

npgsql ef integration doesn't provide a callback that accepts an IServiceProvider #7016

aaronpowell opened this issue Jan 3, 2025 · 1 comment · May be fixed by #7017

Comments

@aaronpowell
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I'm porting a codebase to use .NET Aspire and the way that it configures the DbContext is that it uses the callback that takes an IServiceProvider and the options builder: https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.entityframeworkservicecollectionextensions.adddbcontext?view=efcore-9.0#microsoft-extensions-dependencyinjection-entityframeworkservicecollectionextensions-adddbcontext-1(microsoft-extensions-dependencyinjection-iservicecollection-system-action((system-iserviceprovider-microsoft-entityframeworkcore-dbcontextoptionsbuilder))-microsoft-extensions-dependencyinjection-servicelifetime-microsoft-extensions-dependencyinjection-servicelifetime)

Aspire doesn't provide access to this, only to the one that takes the DbContextOptionsBuilder, which means that we have to refactor how things are configured.

Expected Behavior

If the Aspire integration is going to "shadow" the native integration, it should match the API surface area.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

@aaronpowell
Copy link
Contributor Author

This is also a problem with the MySQL integration

aaronpowell added a commit to aaronpowell/aspire that referenced this issue Jan 3, 2025
@aaronpowell aaronpowell linked a pull request Jan 3, 2025 that will close this issue
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant