SoCreate / service-fabric-distributed-cache

MIT License
36 stars 19 forks source link

Adding class to support creating a IDistributedCache instance outside… #8

Closed joshuaitguy closed 1 year ago

joshuaitguy commented 4 years ago

… of ASP.NET Core Applications.

PixelByProxy commented 4 years ago

I'd like to see this implemented as well. I'm using the cache from another service fabric application using Autofac as the DI provider.

WhitWaldo commented 2 years ago

I know this is a bit of an old thread, but just wanted to chime in with why this class isn't necessary if you're using Autofac. If you've got the Microsoft.Extensions.DependencyInjection package installed, you can just do the following while populating your builder to register everything via the ASP.NET Core style.

var builder = new ContainerBuilder();
//...
var services = new ServiceCollection();
services.AddDistributedServiceFabricCache();
builder.Populate(services);