Ejemplo n.º 1
0
        private static void CheckDbDependency(ConnectionConfig config)
        {
            switch (config.DbType)
            {
            case DbType.MySql:
                DependencyManagement.TryMySqlData();
                break;

            case DbType.SqlServer:
                break;

            case DbType.Sqlite:
                DependencyManagement.TrySqlite();
                break;

            case DbType.Oracle:
                DependencyManagement.TryOracle();
                break;

            case DbType.PostgreSQL:
                DependencyManagement.TryPostgreSQL();
                break;

            case DbType.Kdbndp:
                DependencyManagement.TryKdbndb();
                break;

            case DbType.Dm:
                DependencyManagement.TryDm();
                break;

            default:
                throw new Exception("ConnectionConfig.DbType is null");
            }
        }
Ejemplo n.º 2
0
        private static void CheckDbDependency(ConnectionConfig config)
        {
            switch (config.DbType)
            {
            case DbType.MySql:
                DependencyManagement.TryMySqlData();
                break;

            case DbType.SqlServer:
                break;

            case DbType.Sqlite:
                DependencyManagement.TrySqlite();
                break;

            case DbType.Oracle:
                DependencyManagement.TryOracle();
                break;

            case DbType.PostgreSQL:
                DependencyManagement.TryPostgreSQL();
                break;

            case DbType.Kdbndp:
                DependencyManagement.TryKdbndb();
                break;

            case DbType.Dm:
                DependencyManagement.TryDm();
                break;

            case DbType.Oscar:
                DependencyManagement.TryOscar();
                break;

            case DbType.MySqlConnector:
                InstanceFactory.CustomDllName = SugarCompatible.IsFramework?"SqlSugar.MySqlConnector": "SqlSugar.MySqlConnectorCore";
                break;

            case DbType.Access:
                InstanceFactory.CustomDllName = SugarCompatible.IsFramework?"SqlSugar.Access": "SqlSugar.AccessCore";
                break;

            case DbType.Custom:
                Check.Exception(InstanceFactory.CustomDbName.IsNullOrEmpty(), "DbType.Custom: InstanceFactory.CustomDbName is not null  ");
                Check.Exception(InstanceFactory.CustomNamespace.IsNullOrEmpty(), "DbType.Custom: InstanceFactory.CustomNamespace is not null  ");
                Check.Exception(InstanceFactory.CustomDllName.IsNullOrEmpty(), "DbType.Custom: InstanceFactory.CustomDllName is not null  ");
                break;

            default:
                throw new Exception("ConnectionConfig.DbType is null");
            }
        }