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

CosmosDbRepository/SqlRepository isn't registered in DI after Startup runs #3

Open
josephatkuvio opened this issue Nov 29, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@josephatkuvio
Copy link
Member

In .NET 6, .AddScoped(typeof(IRepository<>), typeof(CosmosDbRepository<>)) has to be added to the Sparc project's Startup file in order for the repository to be registered in DI. Otherwise the repository lookup fails at runtime. This line of code already exists in both ServiceCollectionExtensions for Cosmos & SQL, so it seems .NET 6 might have messed w/ some DI things as far as ordering and parallel registration.

@josephatkuvio josephatkuvio added the bug Something isn't working label Nov 29, 2021
@josephatkuvio josephatkuvio self-assigned this Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant