Exemplo n.º 1
0
 /// <summary>
 /// TODO: GenericCollectionProvider register in DI
 /// </summary>
 /// <param name="documentClientFactory"></param>
 /// <param name="databaseProvider"></param>
 public GenericRepository(IDocumentClientFactory documentClientFactory, IDatabaseProvider databaseProvider) : this(
         documentClientFactory.GetClient(),
         new GenericCollectionProvider <TDocument>(
             documentClientFactory,
             databaseProvider))
 {
 }
        public GenericCollectionProviderTestFixture(IDocumentClientFactory documentClientFactory)
        {
            _documentClient = documentClientFactory.GetClient();
            _databaseId     = documentClientFactory.GetDatabaseId();

            _collectionProvider = new GenericCollectionProvider <TestDocument>(
                documentClientFactory,
                new DatabaseProvider(documentClientFactory));
        }
Exemplo n.º 3
0
        public DatabaseProvider(IDocumentClientFactory documentClientFactory)
        {
            if (documentClientFactory == null)
            {
                throw new ArgumentNullException(nameof(documentClientFactory));
            }

            _documentClient = documentClientFactory.GetClient();
            _databaseId     = documentClientFactory.GetDatabaseId();
        }
 public GenericCollectionProvider(
     IDocumentClientFactory documentClientFactory,
     IDatabaseProvider databaseProvider)
 {
     if (documentClientFactory == null)
     {
         throw new ArgumentNullException(nameof(documentClientFactory));
     }
     _databaseProvider = databaseProvider ?? throw new ArgumentNullException(nameof(databaseProvider));
     _documentClient   = documentClientFactory.GetClient();
 }
 public DatabaseProviderTestFixture(IDocumentClientFactory documentClientFactory)
 {
     _documentClient   = documentClientFactory.GetClient();
     _databaseId       = documentClientFactory.GetDatabaseId();
     _databaseProvider = new DatabaseProvider(null);
 }