Пример #1
0
        public async Task AddAsync <TAggregate>(TAggregate aggregate) where TAggregate : IAggregate
        {
            aggregate.ID       = Guid.NewGuid();
            aggregate.TenantID = _tenantAccessor.TenantID;

            var collection = _mongoDbClient.GetCollection <TAggregate>(typeof(TAggregate).Name);

            await collection.InsertOneAsync(aggregate);
        }
        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);
        }
 public CustomerRepository(IMongoDbClient <ContactDB> contactDB)
 {
     _contactDB    = contactDB;
     _customerColl = _contactDB.GetCollection <CustomerModel>();
 }
Пример #5
0
 public ProductDbSender(IMongoDbClient mongoDbClient)
 {
     _mongoCollection = mongoDbClient.GetCollection <Product>("products");
 }
Пример #6
0
 public StateInfoRepository(IMongoDbClient <GeographicDB> geographicDb)
 {
     this.StateInfoColl = geographicDb.GetCollection <StateInfo>();
 }
Пример #7
0
 public OccurenceRepository(IMongoDbClient <ClaimsDb> alertsDb)
 {
     _occurrences = alertsDb.GetCollection <Occurrence>();
 }
Пример #8
0
 public CustomerRepository(
     IMongoDbClient <ContactDb> contactDb)
 {
     _customerColl = contactDb.GetCollection <Customer>();
 }
Пример #9
0
 public SubmissionRepository(IMongoDbClient <AlertsDb> alertsDb)
 {
     _occurrences = alertsDb.GetCollection <OccurrenceAlert>();
 }
 public EntityScriptMetaRepository(EntityScriptMetaDb settings, IMongoDbClient <EntityScriptMetaDb> mongoClient)
 {
     _mongoClient        = mongoClient;
     _scriptMetadataColl = mongoClient.GetCollection <EntityScriptMeta>(settings.CollectionName);
 }