예제 #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>();
            });
        }