Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

asp net core dependency injection factory with parameters

services.AddSingleton<ICacheProvider>(provider => new RedisCacheProvider("myPrettyLocalhost:6379"));

services.AddSingleton<ICacheProvider>(new RedisCacheProvider("myPrettyLocalhost:6379"));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #asp #net #core #dependency #injection #factory #parameters
ADD COMMENT
Topic
Name
4+3 =