Exemple #1
0
        /// <summary>
        /// Construtor
        /// </summary>
        /// <param name="Config"></param>
        /// <param name="EntityType"></param>
        public MongoDBHelper(MongoDBConfig Config, Type EntityType)
        {
            _Config = Config;

            this.CollectionName = EntityType.Name;

            this.Db = this.GetDBInstance();
        }
Exemple #2
0
        public BaseData(IConfiguration Configuration)
        {
            this._configuration = Configuration;

            //These settings are checked on the helper class
            MongoDBConfig = new MongoDBConfig(
                _configuration[MongoDBConfig.KeyNameConnectionString],
                _configuration[MongoDBConfig.KeyNameDatabaseName]
                );

            this.CollectionName = typeof(T).Name;

            //Set Helper Instance
            this.Helper = new MongoDBHelper(this.MongoDBConfig, typeof(T));
        }