コード例 #1
0
ファイル: RedisAssimilation.cs プロジェクト: cmgator/Symbiote
 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
ファイル: RedisDependencies.cs プロジェクト: cmgator/Symbiote
 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>();
            });
        }