I\'m using vNext implementation of DI. How to pass parameters to constructor? For example, i have class:
public class RedisCacheProvider : ICacheProvider
{
You can either provide a delegate to manually instantiate your cache provider or directly provide an instance:
services.AddSingleton(provider => new RedisCacheProvider("myPrettyLocalhost:6379"));
services.AddSingleton(new RedisCacheProvider("myPrettyLocalhost:6379"));
Please note that the container will not explicitly dispose of manually instantiated types, even if they implement IDisposable. See the ASP.NET Core doc about Disposal of Services for more info.