Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

IServiceCollection / DependencyInjection issue

$
0
0
In our web app, as expected, the DbContext for our data is injected with DI.

It is registered with this extension method (the one that take a Func<> factory method):
publicstatic IServiceCollection AddScoped<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory) where TService : class;

Now every now and then, due to maintenance task in our UAT servers, the Database is offline for a little while.
If that ever happen while someone try to connect to the DB, anyservice that need that DbContext fail with the same exception. Regardless whether the DB is back online or not.
We need to restart the app to fix that.

Now I wonder.. is there a way to fix that? (A way that doesn't involve restarting our app!)
A new .NET Serializer
All in one Menu-Ribbon Bar
Taking over the world since 1371!

Viewing all articles
Browse latest Browse all 3938

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>