protected static IVersionedDocumentStoreClient CreateStoreLogic( IDocumentDbAccess dbAccess, DocumentStoreConfig config, IDocumentMetadataSource metadataSource) { return(new VersionedDocumentStoreClient(GetDbAccessImplementation(dbAccess), config, metadataSource)); }
/// <summary> /// Initialises a new instance of the <see cref="DocumentDbAccessProvider"/> class. /// </summary> /// <param name="dbAccessFactory">The db access factory.</param> public DocumentDbAccessProvider(IDocumentDbAccessFactory dbAccessFactory) { if (dbAccessFactory == null) { throw new ArgumentNullException(nameof(dbAccessFactory)); } _dbAccess = dbAccessFactory.Create(); }
protected static IVersionedDocumentStorePurgeClient CreatePurgeLogic( IDocumentDbAccess dbAccess, DocumentStoreConfig config) { var dbAccessImpl = GetDbAccessImplementation(dbAccess); var queryClient = new VersionedDocumentQueryClient(dbAccessImpl, config); return(new VersionedDocumentStorePurgeClient(dbAccessImpl, config, queryClient)); }
private static DocumentDbAccess GetDbAccessImplementation(IDocumentDbAccess dbAccess) { var documentDbAccess = dbAccess as DocumentDbAccess; if (documentDbAccess == null) { throw new InvalidOperationException("Document db access interface is not a supported type"); } return(documentDbAccess); }
protected static IVersionedDocumentStoreClient CreateStoreLogic(IDocumentDbAccess dbAccess, DocumentStoreConfig config) { var documentDbAccess = dbAccess as DocumentDbAccess; if (documentDbAccess == null) { throw new InvalidOperationException("Document db access interface is not a supported type"); } return(new VersionedDocumentStoreClient(documentDbAccess, config)); }
protected VersionedDocumentStore(IDocumentDbAccess dbAccess, IDocumentStoreConfigSource existingSource) { if (dbAccess == null) { throw new ArgumentNullException(nameof(dbAccess)); } if (existingSource == null) { throw new ArgumentNullException(nameof(existingSource)); } DbAccess = dbAccess; if (!dbAccess.ConfigRegistry.IsStoreConfigRegistered(existingSource)) { throw new ArgumentException("Store config has not been registed"); } }
protected static IUnversionedDocumentStoreClient CreateStoreLogic( IDocumentDbAccess dbAccess, DocumentStoreConfig config) { return(new UnversionedDocumentStoreClient(GetDbAccessImplementation(dbAccess), config)); }