public static IAssimilate Riak( this IAssimilate assimilate, Action<RiakConfigurator> configurate ) { var configurator = new RiakConfigurator(); configurate( configurator ); Assimilate.Dependencies( x => x.For<IRiakConfiguration>().Use( configurator.Configuration ) ); return assimilate; }
public Action<DependencyConfigurator> Dependencies() { var configurator = new RiakConfigurator(); return container => { container.For<IRiakConfiguration>().Use( configurator.Configuration ); container.For<IConnectionFactory>().Use<ConnectionFactory>(); container.For<IConnectionProvider>().Use<PooledConnectionProvider>().AsSingleton(); container.For<ICommandFactory>().Use<ProtoBufCommandFactory>().AsSingleton(); container.For<IConnectionPool>().Use<LockingConnectionPool>(); container.For<IRiakClient>().Use<RiakClient>(); container.For<IDocumentRepository>().Use<RiakClient>(); container.For<IKeyValueStore>().Use<RiakClient>(); container.For<ITrackVectors>().Use<VectorRegistry>().AsSingleton(); }; }
public Action <DependencyConfigurator> Dependencies() { var configurator = new RiakConfigurator(); return(container => { container.For <IRiakConfiguration>().Use(configurator.Configuration); container.For <IConnectionFactory>().Use <ConnectionFactory>(); container.For <IConnectionProvider>().Use <PooledConnectionProvider>().AsSingleton(); container.For <ICommandFactory>().Use <ProtoBufCommandFactory>().AsSingleton(); container.For <IConnectionPool>().Use <LockingConnectionPool>(); container.For <IRiakClient>().Use <RiakClient>(); container.For <IDocumentRepository>().Use <RiakClient>(); container.For <IKeyValueStore>().Use <RiakClient>(); container.For <ITrackVectors>().Use <VectorRegistry>().AsSingleton(); }); }