Пример #1
0
 public static IAssimilate Redis( this IAssimilate assimilate, Action<RedisConfigurator> configure )
 {
     var configurator = new RedisConfigurator();
     configure( configurator );
     Assimilate.Dependencies( x => x.For<RedisConfiguration>().Use( configurator.Configuration ) );
     return assimilate;
 }
Пример #2
0
        public static IAssimilate Redis(this IAssimilate assimilate, Action <RedisConfigurator> configure)
        {
            var configurator = new RedisConfigurator();

            configure(configurator);
            Assimilate.Dependencies(x => x.For <RedisConfiguration>().Use(configurator.Configuration));
            return(assimilate);
        }
Пример #3
0
 public Action<DependencyConfigurator> Dependencies()
 {
     var configurator = new RedisConfigurator();
     return x =>
                {
                    x.For<RedisConfiguration>().Use( configurator.Configuration );
                    x.For<IConnectionPool>().Use<LockingConnectionPool>().AsSingleton();
                    x.For<IRedisClient>().Use<RedisClient>();
                    x.For<ICacheSerializer>().Use<ProtobufCacheSerializer>();
                    x.For<IConnectionProvider>().Use<PooledConnectionProvider>();
                    x.For<IConnectionFactory>().Use<ConnectionFactory>();
                };
 }
Пример #4
0
        public Action <DependencyConfigurator> Dependencies()
        {
            var configurator = new RedisConfigurator();

            return(x =>
            {
                x.For <RedisConfiguration>().Use(configurator.Configuration);
                x.For <IConnectionPool>().Use <LockingConnectionPool>().AsSingleton();
                x.For <IRedisClient>().Use <RedisClient>();
                x.For <ICacheSerializer>().Use <ProtobufCacheSerializer>();
                x.For <IConnectionProvider>().Use <PooledConnectionProvider>();
                x.For <IConnectionFactory>().Use <ConnectionFactory>();
            });
        }