コード例 #1
0
        private static BlogSyncService GetBlogSyncService(IDocumentStore documentStore)
        {
            if (documentStore == null)
            {
                throw new ArgumentNullException(nameof(documentStore));
            }

            var blogSource = AppSettingsFactory.BuildBlogSource((username, password) => new BloggerBlogSource(password));

            var dataStorage = new RavenDbDataStorage(documentStore);

            var syncConfig = new BlogSyncConfiguration(blogSource, dataStorage, blogSettings: BlogSettingsLazy.Value);

            syncConfig.TransformersProvider.Transformers.Clear();

            var blogSync = new BlogSyncService(syncConfig);
            return blogSync;
        }
コード例 #2
0
        private static BlogSyncService GetBlogSyncService(IDocumentStore documentStore)
        {
            if (documentStore == null)
            {
                throw new ArgumentNullException(nameof(documentStore));
            }

            var blogSource = AppSettingsFactory.BuildBlogSource((username, password) => new BloggerBlogSource(password));

            var dataStorage = new RavenDbDataStorage(documentStore);

            var syncConfig = new BlogSyncConfiguration(blogSource, dataStorage, blogSettings: BlogSettingsLazy.Value);

            syncConfig.TransformersProvider.Transformers.Clear();

            var blogSync = new BlogSyncService(syncConfig);

            return(blogSync);
        }
コード例 #3
0
        protected override IDataStorage GetDataStorage(
            IEnumerable<BlogMeta> blogMetas = null,
            IEnumerable<BlogPost> blogPosts = null)
        {
            var documentStore = EmbeddableDocumentStoreTestFactory.CreateWithData(blogMetas: blogMetas, blogPosts: blogPosts);

            var dataStorage = new RavenDbDataStorage(documentStore);
            return dataStorage;
        }