public void AtomicIsInMemory(Action<DefaultAtomicStorageStrategyBuilder> configure)
 {
     var dictionary = new ConcurrentDictionary<string, byte[]>();
     var builder = new DefaultAtomicStorageStrategyBuilder();
     configure(builder);
     AtomicIs(new MemoryAtomicStorageFactory(dictionary, builder.Build()));
 }
Beispiel #2
0
        public void AtomicIsInFiles(string folder, Action <DefaultAtomicStorageStrategyBuilder> configure)
        {
            var builder = new DefaultAtomicStorageStrategyBuilder();

            configure(builder);
            AtomicIs(new FileAtomicStorageFactory(folder, builder.Build()));
        }
Beispiel #3
0
        public static void AtomicIsInAzure(this StorageModule self, IAzureStorageConfig storage, Action <DefaultAtomicStorageStrategyBuilder> config)
        {
            var builder = new DefaultAtomicStorageStrategyBuilder();

            config(builder);
            AtomicIsInAzure(self, storage, builder.Build());
        }
Beispiel #4
0
        public void AtomicIsInMemory(Action <DefaultAtomicStorageStrategyBuilder> configure)
        {
            var dictionary = new ConcurrentDictionary <string, byte[]>();
            var builder    = new DefaultAtomicStorageStrategyBuilder();

            configure(builder);
            AtomicIs(new MemoryAtomicStorageFactory(dictionary, builder.Build()));
        }
 /// <summary>
 /// Creates the simplified nuclear storage wrapper around Atomic storage.
 /// </summary>
 /// <param name="dictionary">The dictionary.</param>
 /// <param name="configStrategy">The config strategy.</param>
 /// <returns></returns>
 public static NuclearStorage CreateNuclear(MemStore dictionary,
     Action<DefaultAtomicStorageStrategyBuilder> configStrategy)
 {
     var strategyBuilder = new DefaultAtomicStorageStrategyBuilder();
     configStrategy(strategyBuilder);
     var strategy = strategyBuilder.Build();
     return CreateNuclear(dictionary, strategy);
 }
 /// <summary>
 /// Creates the simplified nuclear storage wrapper around Atomic storage.
 /// </summary>
 /// <param name="storageFolder">The storage folder.</param>
 /// <param name="configStrategy">The config strategy.</param>
 /// <returns></returns>
 public static NuclearStorage CreateNuclear(string storageFolder,
     Action<DefaultAtomicStorageStrategyBuilder> configStrategy)
 {
     var strategyBuilder = new DefaultAtomicStorageStrategyBuilder();
     configStrategy(strategyBuilder);
     var strategy = strategyBuilder.Build();
     return CreateNuclear(storageFolder, strategy);
 }
Beispiel #7
0
        /// <summary> Creates the simplified nuclear storage wrapper around Atomic storage. </summary>
        /// <param name="storageConfig">The storage config.</param>
        /// <param name="configStrategy">The config strategy.</param>
        /// <returns></returns>
        public static NuclearStorage CreateNuclear(IAzureStorageConfig storageConfig, Action <DefaultAtomicStorageStrategyBuilder> configStrategy)
        {
            var strategyBuilder = new DefaultAtomicStorageStrategyBuilder();

            configStrategy(strategyBuilder);
            var strategy = strategyBuilder.Build();

            return(CreateNuclear(storageConfig, strategy));
        }
Beispiel #8
0
        public static NuclearStorage CreateNuclear(this FileStorageConfig self, Action <DefaultAtomicStorageStrategyBuilder> config)
        {
            var strategyBuilder = new DefaultAtomicStorageStrategyBuilder();

            config(strategyBuilder);
            var strategy = strategyBuilder.Build();

            return(CreateNuclear(self, strategy));
        }
        /// <summary>
        /// Creates the simplified nuclear storage wrapper around Atomic storage.
        /// </summary>
        /// <param name="dictionary">The dictionary.</param>
        /// <param name="configStrategy">The config strategy.</param>
        /// <returns></returns>
        public static NuclearStorage CreateNuclear(MemStore dictionary,
                                                   Action <DefaultAtomicStorageStrategyBuilder> configStrategy)
        {
            var strategyBuilder = new DefaultAtomicStorageStrategyBuilder();

            configStrategy(strategyBuilder);
            var strategy = strategyBuilder.Build();

            return(CreateNuclear(dictionary, strategy));
        }
 public static void AtomicIsInSql(this StorageModule self, ISqlStorageConfig storage, Action<DefaultAtomicStorageStrategyBuilder> config)
 {
     var builder = new DefaultAtomicStorageStrategyBuilder();
     config(builder);
     AtomicIsInSql(self, storage, builder.Build());
 }
 public void AtomicIsInFiles(string folder, Action<DefaultAtomicStorageStrategyBuilder> configure)
 {
     var builder = new DefaultAtomicStorageStrategyBuilder();
     configure(builder);
     AtomicIs(new FileAtomicStorageFactory(folder, builder.Build()));
 }