Пример #1
0
        /// <summary>
        /// 获得当前数据库类型
        /// </summary>
        /// <param name="database"></param>
        /// <returns></returns>
        public static DataBaseType GetDbType(this System.Data.Entity.Database database)
        {
            DataBaseType dbType = DbConnections.GetDbTypeByConn(database.Connection);

            if (dbType == DataBaseType.Sqlite)
            {
                SQLiteProviderFactory factory = SQLiteProviderFactory.Instance;
            }
            return(dbType);
        }
Пример #2
0
        public EntityHelper(DbConnection connection, params string[] assemblys)
        {
            this._conn = connection;
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }

            _dbType        = DbConnections.GetDbTypeByConn(connection);
            _dbHelper      = DBHelper.DBHelper.GetDBHelper(_conn);
            this.assemblys = assemblys;
        }