예제 #1
0
        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>();
        }
예제 #2
0
 protected RedisContext(RedisContextOptions options)
 {
     _options = options;
     Connect();
     SetContext();
 }