Ejemplo n.º 1
0
        public PooledCouchConveyor(IDispatcherFactory <CouchConveyEntry <T> > factory, int workers = 1, int capacity = 0)
            : base(factory, workers, capacity)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            // TODO: Extract this if we need to customize MyCouch
            this.MyCouchClientBootstrapper = new MyCouchClientBootstrapper();
            this.Serializer = this.MyCouchClientBootstrapper.SerializerFn();
        }
Ejemplo n.º 2
0
        public static MyCouchStore Create(CouchDbConnection cn, string dbName)
        {
            // configure the JSON serializers to include the $type field in the JSON to support deserializing to the
            // concrete classes where we used inheritance and interfaces / base classes.
            var bootstrapper = new MyCouchClientBootstrapper();

            bootstrapper.SerializationConfigurationFn = () => {
                var cfg = new SerializationConfiguration(new SerializationContractResolver());
                cfg.Settings.TypeNameHandling = TypeNameHandling.Objects;
                return(cfg);
            };

            var client = new MyCouchClient(CouchDbConnection.Current.ServerUrl, dbName, bootstrapper);
            var store  = new MyCouchStore(client);

            return(store);
        }
        public ReplicateDatabaseHttpRequestFactoryTests()
        {
            var boostrapper = new MyCouchClientBootstrapper();

            SUT = new ReplicateDatabaseServerHttpRequestFactory(boostrapper.SerializerFn());
        }
        public QueryViewHttpRequestFactoryTests()
        {
            var boostrapper = new MyCouchClientBootstrapper();

            SUT = new QueryViewHttpRequestFactory(boostrapper.DocumentSerializerFn());
        }
Ejemplo n.º 5
0
        public PurgeEntityHttpRequestFactoryTests()
        {
            var boostrapper = new MyCouchClientBootstrapper();

            SUT = new PurgeEntityHttpRequestFactory(boostrapper.EntityReflectorFn(), boostrapper.DocumentSerializerFn());
        }
Ejemplo n.º 6
0
        public PurgeResponseFactoryTests()
        {
            var boostrapper = new MyCouchClientBootstrapper();

            SUT = new PurgeResponseFactory(boostrapper.DocumentSerializerFn());
        }
        public SearchIndexHttpRequestFactoryTests()
        {
            var boostrapper = new MyCouchClientBootstrapper();

            SUT = new SearchIndexHttpRequestFactory(boostrapper.SerializerFn());
        }