public static void AddRedisContext <T>(this IServiceCollection services, Action <RedisContextOptions> options)
            where T : RedisContext
        {
            RedisContextOptions opt = new RedisContextOptions();

            options(opt);
            services.AddSingleton(opt);
            services.AddScoped <T>();
        }
Example #2
0
 protected RedisContext(RedisContextOptions options)
 {
     _options = options;
     Connect();
     SetContext();
 }