sparc-coop / blossom

Blossom is an opinionated framework-of-a-framework for .NET 7.0 Web, Mobile, and Desktop development using a single shared codebase (C# and Blazor).
MIT License
17 stars 2 forks source link

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

Open josephatkuvio opened 2 years ago

josephatkuvio commented 2 years ago

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.