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>(); }
public ProductDbSender(IMongoDbClient mongoDbClient) { _mongoCollection = mongoDbClient.GetCollection <Product>("products"); }
public StateInfoRepository(IMongoDbClient <GeographicDB> geographicDb) { this.StateInfoColl = geographicDb.GetCollection <StateInfo>(); }
public OccurenceRepository(IMongoDbClient <ClaimsDb> alertsDb) { _occurrences = alertsDb.GetCollection <Occurrence>(); }
public CustomerRepository( IMongoDbClient <ContactDb> contactDb) { _customerColl = contactDb.GetCollection <Customer>(); }
public SubmissionRepository(IMongoDbClient <AlertsDb> alertsDb) { _occurrences = alertsDb.GetCollection <OccurrenceAlert>(); }
public EntityScriptMetaRepository(EntityScriptMetaDb settings, IMongoDbClient <EntityScriptMetaDb> mongoClient) { _mongoClient = mongoClient; _scriptMetadataColl = mongoClient.GetCollection <EntityScriptMeta>(settings.CollectionName); }