Example #1
0
 public MongodbRepository(MongodbContext context, IMediator mediator, INotificationManager msg)
 {
     _mediator   = mediator;
     _msg        = msg;
     _database   = context.Database;
     _collection = _database.GetCollection <T>(typeof(T).Name);
 }
        public static List <QueryConfig> BuildConfigApp(IDataSourceSettings dbSettings)
        {
            IMongodbContext context = new MongodbContext(dbSettings);

            var listOfQueryConfigs = context.GetCollection <QueryConfig>(dbSettings.Entity).AsQueryable().ToList();

            return(listOfQueryConfigs);
        }
Example #3
0
        public MongoDBRepository()
        {
            this.RegisterAutoMap();

            IMongoDatabase Database       = MongodbContext.GetDatabase();
            String         collectionName = this.GetCollectionName();

            this._mongoCollection = Database.GetCollection <T>(collectionName);
        }
Example #4
0
        public static void BuildConfiguration()
        {
            var collectionOfConnectStrings = ConfigurationHelper.LoadConfiguration();
            IDataSourceSettings settings   = new DataSourceSettings
            {
                ConnectionString =
                    collectionOfConnectStrings.ReadWriteConnectionString,
                Database = collectionOfConnectStrings.Database,
                Entity   = collectionOfConnectStrings.Entity
            };

            var collectionName = collectionOfConnectStrings.Entity;

            IMongodbContext context = new MongodbContext(settings);

            var collection = context.GetCollection <QueryConfig>(collectionName);

            collection.DeleteMany(new BsonDocument()); //delete all

            collection.InsertMany(SeedData.GetConfigurationData(collectionOfConnectStrings));
        }
 public DatabaseRepository(MongodbContext context)
 {
     _context = context;
 }
Example #6
0
 public UserRepository(MongodbContext context)
     : base(context)
 {
 }
Example #7
0
 public SetupService()
 {
     _db = WebConfig.GetMongodb();
 }
 public ConsumerErrorMessageStore(MongodbContext <LogMongoSettings> mongoDatabase, ILogger <NoSqlBaseRepository <ConsumerErrorMessage, LogMongoSettings> > logger)
     : base(mongoDatabase, logger)
 {
 }
Example #9
0
 public MessageHandlerResultStore(MongodbContext <LogMongoSettings> mongoDatabase, ILogger <NoSqlBaseRepository <MessageHandlerResult, LogMongoSettings> > logger)
     : base(mongoDatabase, logger)
 {
 }
Example #10
0
 public DefaultMongoStore(MongodbContext <LogMongoSettings> mongoDatabase,
                          ILogger <NoSqlBaseRepository <TCollection, LogMongoSettings> > logger) : base(mongoDatabase, logger)
 {
 }
 public AppNoSqlBaseRepository(MongodbContext <MongoDefaultSetting> mongoDatabase, ILogger <AppNoSqlBaseRepository <TEntity> > logger)
     : base(mongoDatabase, logger)
 {
 }
Example #12
0
 public IPRepository(IOptions <Settings> settings)
 {
     _context = new MongodbContext(settings);
 }
 public ConsumerRetryPolicyStore(MongodbContext <LogMongoSettings> mongoDatabase, ILogger <NoSqlBaseRepository <ConsumerRetryPolicy, LogMongoSettings> > logger)
     : base(mongoDatabase, logger)
 {
 }
 public MongodbRepository(MongodbContext context)
 {
     this.context = context;
 }
 public EntityRepository(MongodbContext context, IMediator mediator, INotificationManager msg) : base(context, mediator, msg)
 {
 }
Example #16
0
 public MockServerNoSqlRepository(MongodbContext <MockServerMongoSettings> mongoDatabase, ILogger <NoSqlBaseRepository <TEntity, MockServerMongoSettings> > logger) : base(mongoDatabase, logger)
 {
 }
Example #17
0
 public MongodbLogBaseRepository(MongodbContext context) : base(context.ConnectionString, nameof(MongoDB.APILogs))
 {
 }