public void CreateSignatureForInequalConfigs()
        {
            DocumentStoreConfigBuilder builder = new DocumentStoreConfigBuilder("StoreA");

            builder.AddDocument("DocA");

            DocumentStoreConfigBuilder builderChangedStoreName = new DocumentStoreConfigBuilder("StoreB");

            builderChangedStoreName.AddDocument("DocA");

            DocumentStoreConfigBuilder builderChangedDocName = new DocumentStoreConfigBuilder("StoreA");

            builderChangedDocName.AddDocument("DocC");

            var configA = new[] { builder.Finish() };
            var configB = new[] { builderChangedStoreName.Finish() };
            var configC = new[] { builderChangedDocName.Finish() };

            DoSignatureInequalTest(new IList <DocumentStoreConfig>[] { configA, configB, configC });
        }
            public DocumentStore(IDocumentDbAccessProvider dbAccessProvider) : base(dbAccessProvider)
            {
                var config = new DocumentStoreConfigBuilder("Documents");

                var documentType  = config.AddDocument("Document1");
                var document2Type = config.AddDocument("Document2");

                _documentMapping = config.AddDocumentMapping <Document1>(documentType.Name)
                                   .SetIdMapper(x => x.Id.ToString())
                                   .SetPartitionMapper(x => x.Id.ToString())
                                   .Finish();

                _document2Mapping = config.AddDocumentMapping <Document2>(document2Type.Name)
                                    .SetIdMapper(x => x.Id.ToString())
                                    .SetPartitionMapper(x => x.Id.ToString())
                                    .Finish();

                _config = config.Finish();
                _client = CreateStoreLogic(DbAccess, _config);
            }
Beispiel #3
0
        public FlowerStore(
            IDocumentDbAccessProvider dbAccessProvider,
            IDocumentMetadataSource metadataSource) : base(dbAccessProvider, false)
        {
            var config = new DocumentStoreConfigBuilder("Flowers");

            var daisyDocumentType = config.AddDocument("Daisy").Finish();
            var roseDocumentType  = config.AddDocument("Rose").Finish();

            _daisyMapping = config.AddDocumentMapping <Daisy>(daisyDocumentType.DocumentName)
                            .SetIdMapper(x => x.Id.ToString())
                            .SetPartitionMapper(x => x.Id.ToString())
                            .Finish();

            _gardenMapping = config.AddDocumentMapping <Garden>(roseDocumentType.DocumentName)
                             .SetIdMapper(x => x.Id.ToString())
                             .SetPartitionMapper(x => x.Id.ToString())
                             .Finish();

            _config = config.Finish();
            _client = CreateStoreLogic(DbAccess, _config, metadataSource);
        }
            public FruitStore(IDocumentDbAccessProvider dbAccessProvider, IDocumentMetadataSource metadataSource)
                : base(dbAccessProvider, false)
            {
                var config = new DocumentStoreConfigBuilder("Fruit");

                var appleDocumentType = config.AddDocument("Apple").Finish();
                var pearDocumentType  = config.AddDocument("Pear").Finish();

                _appleMapping = config.AddDocumentMapping <Apple>(appleDocumentType.DocumentName)
                                .SetIdMapper(x => x.Id.ToString())
                                .SetPartitionMapper(x => x.Id.ToString())
                                .Finish();

                _pearMapping = config.AddDocumentMapping <Pear>(pearDocumentType.DocumentName)
                               .SetIdMapper(x => x.Id.ToString())
                               .SetPartitionMapper(x => x.Id.ToString())
                               .Finish();

                _config = config.Finish();
                _client = CreateStoreLogic(DbAccess, _config, metadataSource);

                DbAccess.ConfigRegistry.RegisterStoreConfigSource(this);
            }