Пример #1
0
 public MongoDbAggregateStore(
     IMongoDbClient mongoDbClient,
     ITenantAccessor tenantAccessor)
 {
     _mongoDbClient  = mongoDbClient;
     _tenantAccessor = tenantAccessor;
 }
        public BrokerMetaRepository(BrokerMetaDb settings, IMongoDbClient <BrokerMetaDb> dbClient)
        {
            Check.NotNull(dbClient, nameof(dbClient));

            _dbClient   = dbClient;
            _brokerColl = _dbClient.GetCollection <BrokerMeta>(settings.CollectionName);
        }
        public ReferenceTypeRepository(ReferenceTypeDb refTypeDb, IMongoDbClient <ReferenceTypeDb> referenceTypeDb)
        {
            // TODO:  expose the underlying db-settings off of the IMongoDbClient...
            // so it doesn't have to be injected separately and accessed off of the
            // already injected db-client.

            _referenceTypeDb       = referenceTypeDb;
            this.ReferenceTypeColl = _referenceTypeDb.GetCollection <ReferenceType>(refTypeDb.CollectionName);
        }
Пример #4
0
        public DummyMongoDbClientApplication(ILogger<DummyAwsClientApplication> logger, IConfiguration configuration, IMongoDbClient mongoDbClient)
        {
            this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
            this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
            this.mongoDbClient = mongoDbClient ?? throw new ArgumentNullException(nameof(mongoDbClient));

            // TODO: To improve! Checking if connectionstring exists; can connect, ..etc...
            string connectionString = configuration["DataStores:MongoDb:Cluster0"];
            this.mongoDbClient.Init(connectionString);
        }
Пример #5
0
        public LiveRepository(IMongoDbClient dbClient, IGenericRepository <LiveEventKill> genericEventKillRepository,
                              IGenericRepository <LiveMatchStatus> genericmatchstates, IGenericRepository <EventLiveMatchStatus> genericEventlivestateRepository,
                              IGenericRepository <EventDamage> genericLiveDamage)

        {
            _eventDamageCollection           = dbClient.Database.GetCollection <EventDamage>("LiveEventDamage");
            _teamPlayerCollection            = dbClient.Database.GetCollection <TeamPlayer>("TeamPlayers");
            _teamCollection                  = dbClient.Database.GetCollection <Team>("Team");
            _genericEventKillRepository      = genericEventKillRepository;
            _genericmatchstates              = genericmatchstates;
            _genericEventlivestateRepository = genericEventlivestateRepository;
            _genericLiveDamage               = genericLiveDamage;
        }
Пример #6
0
 public ClientsService(IMongoDbClient client)
 {
     _client = client;
 }
Пример #7
0
 public MongoDbCollection(IMongoDbClient mongoDbClient)
 {
     _mongoDbClient = mongoDbClient;
 }
Пример #8
0
 public ProductDbSender(IMongoDbClient mongoDbClient)
 {
     _mongoCollection = mongoDbClient.GetCollection <Product>("products");
 }
Пример #9
0
        public TitlesService(IMongoDbClient client)
        {
            var database = client.GetDatabase();

            _titlesCollection = database.GetCollection <Title>("Titles");
        }
Пример #10
0
 public StateInfoRepository(IMongoDbClient <GeographicDB> geographicDb)
 {
     this.StateInfoColl = geographicDb.GetCollection <StateInfo>();
 }
Пример #11
0
 public AvailabilityStorage(IMongoDbClient client)
 {
     _collection = GetOrCreateCollection(client).GetAwaiter().GetResult();
 }
Пример #12
0
 public CheckOutServices(IMongoDbClient client)
 {
     _client = client;
 }
Пример #13
0
 public CashDeskServices(IMongoDbClient client)
 {
     _client = client;
 }
Пример #14
0
 public CustomerRepository(
     IMongoDbClient <ContactDb> contactDb)
 {
     _customerColl = contactDb.GetCollection <Customer>();
 }
Пример #15
0
 public CaissesService(IMongoDbClient client)
 {
     _client = client;
 }
Пример #16
0
 public CustomerServices(IMongoDbClient client)
 {
     _client = client;
 }
Пример #17
0
        private static async Task <IMongoCollection <AccommodationAvailabilityResult> > GetOrCreateCollection(IMongoDbClient client)
        {
            var collection = client.GetDatabase().GetCollection <AccommodationAvailabilityResult>(nameof(AccommodationAvailabilityResult));

            var searchIndexDefinition = Builders <AccommodationAvailabilityResult> .IndexKeys.Combine(
                Builders <AccommodationAvailabilityResult> .IndexKeys.Ascending(f => f.SearchId),
                Builders <AccommodationAvailabilityResult> .IndexKeys.Ascending(f => f.Supplier));

            var ttlIndexDefinition = Builders <AccommodationAvailabilityResult> .IndexKeys.Ascending(f => f.Created);

            var ttlIndexOptions = new CreateIndexOptions {
                ExpireAfter = TimeSpan.FromMinutes(RecordTtlInMinutes)
            };

            await collection.Indexes.CreateManyAsync(new []
            {
                new CreateIndexModel <AccommodationAvailabilityResult>(searchIndexDefinition),
                new CreateIndexModel <AccommodationAvailabilityResult>(ttlIndexDefinition, ttlIndexOptions)
            });

            return(collection);
        }
 public RestaurantRepository(IMongoDbClient mongoDbClient, IOptions <MongoDbCollectionSettings> options)
 {
     _mongoDbClient = mongoDbClient;
     _settings      = options.Value;
 }
Пример #19
0
 public SubmissionRepository(IMongoDbClient <AlertsDb> alertsDb)
 {
     _occurrences = alertsDb.GetCollection <OccurrenceAlert>();
 }
Пример #20
0
 public GenericRepository(IMongoDbClient mongoDbClient)
 {
     _mongoDbClient = mongoDbClient;
 }
 public EntityScriptMetaRepository(EntityScriptMetaDb settings, IMongoDbClient <EntityScriptMetaDb> mongoClient)
 {
     _mongoClient        = mongoClient;
     _scriptMetadataColl = mongoClient.GetCollection <EntityScriptMeta>(settings.CollectionName);
 }
Пример #22
0
 public MongoDbDataAccess(IMongoDbClient client)
 {
     _client = client;
 }
Пример #23
0
 public ClienteForQueryRepository(IMongoDbClient mongoDbClient)
 {
     _mongoDbClient = mongoDbClient;
 }
Пример #24
0
 public CustomerRepository(IMongoDbClient <ContactDB> contactDB)
 {
     _contactDB    = contactDB;
     _customerColl = _contactDB.GetCollection <CustomerModel>();
 }
Пример #25
0
 public OccurenceRepository(IMongoDbClient <ClaimsDb> alertsDb)
 {
     _occurrences = alertsDb.GetCollection <Occurrence>();
 }