Browse Source

Update Oscar

pull/8/head
sunkaixuna 3 years ago
parent
commit
33bc22d111
  1. 6
      Src/Asp.NetCore2/SqlSeverTest/OscarTest/Config.cs
  2. 3
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs
  3. 19
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/DependencyManagement.cs

6
Src/Asp.NetCore2/SqlSeverTest/OscarTest/Config.cs

@ -16,16 +16,16 @@ namespace OrmTest
/// Account have permission to create database
/// 用有建库权限的数据库账号
/// </summary>
public static string ConnectionString = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres";
public static string ConnectionString = "PORT=2003;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=szoscar55;USER ID=SYSDBA";
/// <summary>
/// Account have permission to create database
/// 用有建库权限的数据库账号
/// </summary>
public static string ConnectionString2 = "PORT=5432;DATABASE=SqlSugar4xTest2;HOST=localhost;PASSWORD=haosql;USER ID=postgres";
public static string ConnectionString2 = "PORT=2003;DATABASE=SqlSugar4xTest2;HOST=localhost;PASSWORD=szoscar55;USER ID=SYSDBA";
/// <summary>
/// Account have permission to create database
/// 用有建库权限的数据库账号
/// </summary>
public static string ConnectionString3 = "PORT=5432;DATABASE=SqlSugar4xTest3;HOST=localhost;PASSWORD=haosql;USER ID=postgres";
public static string ConnectionString3 = "PORT=2003;DATABASE=SqlSugar4xTest3;HOST=localhost;PASSWORD=szoscar55;USER ID=SYSDBA";
}
}

3
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs

@ -374,6 +374,9 @@ namespace SqlSugar
case DbType.Dm:
DependencyManagement.TryDm();
break;
case DbType.Oscar:
DependencyManagement.TryOscar();
break;
default:
throw new Exception("ConnectionConfig.DbType is null");
}

19
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/DependencyManagement.cs

@ -15,6 +15,7 @@ namespace SqlSugar
private static bool IsTryPgSql = false;
private static bool IsTryDm = false;
private static bool IsTryKd = false;
private static bool IsTryOscar = false;
public static void TryJsonNet()
{
if (!IsTryJsonNet)
@ -149,5 +150,23 @@ namespace SqlSugar
}
}
}
public static void TryOscar()
{
if (!IsTryOscar)
{
try
{
OscarProvider db = new OscarProvider();
var conn = db.GetAdapter();
IsTryOscar = true;
}
catch (Exception ex)
{
var message = "需要引用Oscar.Data.SqlClient.dll,Github搜索sqlsugar源码里面有";
throw new Exception(message);
}
}
}
}
}
Loading…
Cancel
Save