示例#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>();
            });
        }