Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public CustomerRepository(IMongoDbClient <ContactDB> contactDB)
 {
     _contactDB    = contactDB;
     _customerColl = _contactDB.GetCollection <CustomerModel>();
 }
Ejemplo n.º 5
0
 public ProductDbSender(IMongoDbClient mongoDbClient)
 {
     _mongoCollection = mongoDbClient.GetCollection <Product>("products");
 }
Ejemplo n.º 6
0
 public StateInfoRepository(IMongoDbClient <GeographicDB> geographicDb)
 {
     this.StateInfoColl = geographicDb.GetCollection <StateInfo>();
 }
Ejemplo n.º 7
0
 public OccurenceRepository(IMongoDbClient <ClaimsDb> alertsDb)
 {
     _occurrences = alertsDb.GetCollection <Occurrence>();
 }
Ejemplo n.º 8
0
 public CustomerRepository(
     IMongoDbClient <ContactDb> contactDb)
 {
     _customerColl = contactDb.GetCollection <Customer>();
 }
Ejemplo n.º 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);
 }