public XDbProvider(string redisConnectionString, ICosmosDb cosmosCosmosDb) { DocumentCosmosDb = cosmosCosmosDb; Connect(redisConnectionString); Resolver = new DocDbRedisResolver(this); }
public TestingContext(Action <ICosmosDbBuilder> builderCallback, Action <ICosmosDbRepositoryBuilder> repoBuilderCallback) { var services = TestFramework.Services; DbConfig = services.GetRequiredService <IOptions <CosmosDbConfig> >().Value; TestConfig = services.GetRequiredService <IOptions <TestConfig> >().Value.Clone(); EnvConfig = services.GetRequiredService <IOptions <EnvironmentConfig> >().Value; if (EnvConfig.RandomizeCollectionName) { TestConfig.CollectionName = $"{TestConfig.CollectionName}{Guid.NewGuid()}"; } DbClient = new DocumentClient(new Uri(DbConfig.DbEndPoint), DbConfig.DbKey); var builder = new CosmosDbBuilder() .WithId(DbConfig.DbName) .WithDefaultThroughput(400) .AddCollection <T>(TestConfig.CollectionName, repoBuilderCallback); builderCallback?.Invoke(builder); CosmosDb = builder.Build(DbClient); Repo = CosmosDb.Repository <T>(); }
public CosmosDbCollection(ICosmosDb cosmosDb, ICosmosDbCollectionConfig config, PartitionKeyProvider <TModel> partitionKeyProvider = null) { if (cosmosDb == null) { throw new ArgumentNullException(nameof(cosmosDb)); } if (config == null) { throw new ArgumentNullException(nameof(config)); } if (config.DatabaseId == null) { throw new ArgumentNullException($"Missing configuration for DatabaseId: {this.GetType().Name} "); } if (config.ContainerId == null) { throw new ArgumentNullException($"Missing configuration for ContainerId: {this.GetType().Name} "); } this.cosmosDb = cosmosDb; this.config = config; this.partitionKeyProvider = partitionKeyProvider; }
public ICosmosDbRepository Build(IDocumentClient client, ICosmosDb documentDb, int?defaultThroughput) { if (string.IsNullOrWhiteSpace(Id)) { throw new InvalidOperationException("Id not specified"); } var indexingPolicy = new IndexingPolicy { IndexingMode = _indexingMode }; if (_includePaths.Any()) { indexingPolicy.IncludedPaths = new Collection <IncludedPath>(_includePaths); } if (_excludePaths.Any()) { indexingPolicy.ExcludedPaths = new Collection <ExcludedPath>(_excludePaths); } return(new CosmosDbRepository <T>(client, documentDb, Id, indexingPolicy, _throughput ?? defaultThroughput, _storedProcedure)); }
public CosmosProductRepository(ICosmosDb cosmosDbService_) { cosmosDbService = cosmosDbService_; }
public TransactionData(ICosmosDb cosmos) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); TransactionDataCtor(); }
public ReferenceDataData(ICosmosDb cosmos) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); DataCtor(); }
public TransactionData(ICosmosDb cosmos, AutoMapper.IMapper mapper) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); _mapper = Check.NotNull(mapper, nameof(mapper)); TransactionDataCtor(); }
public AccountData(ICosmosDb cosmos) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); AccountDataCtor(); }
public CosmosController(ICosmosDb cosmos) { _cosmos = cosmos; }
public PartitionRepository(ICosmosDb cosmos, string containerName) { this.cosmos = cosmos; this.container = this.cosmos.CreateContainer(containerName).Result; }
public CosmosRepository(ICosmosDb db) { this.FoodRepository = new FoodRepository <Food>(db); }
public ReferenceDataData(IDatabase db, IEfDb ef, ICosmosDb cosmos) { _db = Check.NotNull(db, nameof(db)); _ef = Check.NotNull(ef, nameof(ef)); _cosmos = Check.NotNull(cosmos, nameof(cosmos)); DataCtor(); }
public FoodRepository(ICosmosDb cosmos) : base(cosmos, "/FoodGroup") { }
public ReferenceDataData(IDatabase db, IEfDb ef, ICosmosDb cosmos, AutoMapper.IMapper mapper) { _db = Check.NotNull(db, nameof(db)); _ef = Check.NotNull(ef, nameof(ef)); _cosmos = Check.NotNull(cosmos, nameof(cosmos)); _mapper = Check.NotNull(mapper, nameof(mapper)); DataCtor(); }
public Stores(ICosmosDb cosmosDb) { _storeRepository = cosmosDb.Repository <StoreDocument>(); }
public AccountData(ICosmosDb cosmos, AutoMapper.IMapper mapper) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); _mapper = Check.NotNull(mapper, nameof(mapper)); AccountDataCtor(); }
public ReferenceDataData(ICosmosDb cosmos, AutoMapper.IMapper mapper) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); _mapper = Check.NotNull(mapper, nameof(mapper)); ReferenceDataDataCtor(); }
public RobotData(ICosmosDb cosmos) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); RobotDataCtor(); }
public Queue(ICosmosDb cosmosDb) { _queueRepository = cosmosDb.Repository <QueueDocument>(); }
public CosmosOrderRepository(ICosmosDb cosmosDbService_) { cosmosDbService = cosmosDbService_; }