mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update Core
This commit is contained in:
parent
f8d97e411b
commit
878fc4e433
@ -11,8 +11,7 @@ namespace OrmTest.Demo
|
||||
public static SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.Oracle, IsAutoCloseConnection = true });
|
||||
db.Ado.IsEnableLogEvent = true;
|
||||
db.Ado.LogEventStarting = (sql, pars) =>
|
||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it=>it.ParameterName,it=>it.Value)));
|
||||
Console.WriteLine();
|
||||
|
@ -57,8 +57,7 @@ namespace OrmTest.UnitTest
|
||||
public SqlSugarClient GetInstance2()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { InitKeyType = InitKeyType.Attribute, ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
|
||||
db.Ado.IsEnableLogEvent = true;
|
||||
db.Ado.LogEventStarting = (sql, pars) =>
|
||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Console.WriteLine(sql + "\r\n" + db.RewritableMethods.SerializeObject(pars));
|
||||
Console.WriteLine();
|
||||
|
@ -128,9 +128,8 @@ namespace OrmTest.UnitTest
|
||||
|
||||
public new SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
|
||||
db.Ado.IsEnableLogEvent = true;
|
||||
db.Ado.LogEventStarting = (sql, pars) =>
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });;
|
||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Console.WriteLine(sql + " " + pars);
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ namespace OrmTest.UnitTest
|
||||
using (var db = GetInstance())
|
||||
{
|
||||
//db.Database.IsEnableLogEvent = true;
|
||||
db.Ado.LogEventStarting = (sql, pars) =>
|
||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Console.WriteLine(sql + " " + pars);
|
||||
};
|
||||
|
@ -13,6 +13,7 @@ namespace SqlSugar
|
||||
private static bool IsTrySqlite = false;
|
||||
private static bool IsTryOracle = false;
|
||||
private static bool IsTryPgSql = false;
|
||||
|
||||
public static void TryJsonNet()
|
||||
{
|
||||
if (!IsTryJsonNet)
|
||||
@ -26,11 +27,12 @@ namespace SqlSugar
|
||||
{
|
||||
var message = ErrorMessage.GetThrowMessage(
|
||||
" SqlSugar Some functions are used in newtonsoft ,Nuget references Newtonsoft.Json 9.0.0.1 + .",
|
||||
" SqlSugar 部分功能用到Newtonsoft.Json.dll,需要在Nuget上安装 Newtonsoft.Json 9.0.0.1及以上版本。如果有版本兼容问题请先删除原有引用(注意:所有项目类库),全部重新从NUGET下载,如果还不明白,请查看详细教程 http://www.codeisbug.com/Doc/8/1154");
|
||||
" SqlSugar 部分功能用到Newtonsoft.Json.dll,需要在Nuget上安装 Newtonsoft.Json 9.0.0.1及以上版本,如果有版本兼容问题请先删除原有引用");
|
||||
throw new Exception(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void TryMySqlData()
|
||||
{
|
||||
if (!IsTryMySqlData)
|
||||
@ -64,14 +66,14 @@ namespace SqlSugar
|
||||
catch
|
||||
{
|
||||
var message = ErrorMessage.GetThrowMessage(
|
||||
"You need to refer to Npgsql.dll",
|
||||
"需要引用Npgsql.dll,请在Nuget安装最新稳定版本,如果有版本兼容问题请先删除原有引用");
|
||||
"You need to refer to Npgsql 3.2.7",
|
||||
"你需要引用 Npgsql 3.2.7及以上版本");
|
||||
throw new Exception(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void TryOracle()
|
||||
public static void TryOracle()
|
||||
{
|
||||
if (!IsTryOracle)
|
||||
{
|
||||
@ -84,8 +86,8 @@ namespace SqlSugar
|
||||
catch
|
||||
{
|
||||
var message = ErrorMessage.GetThrowMessage(
|
||||
"You need to refer to Oracle.ManagedDataAccess.dll",
|
||||
"需要引用ManagedDataAccess.dll,请在Nuget安装最新稳定版本,如果有版本兼容问题请先删除原有引用");
|
||||
"You need to refer to Oracle.ManagedDataAccess.Core",
|
||||
"你需要引用 Oracle.ManagedDataAccess.Core");
|
||||
throw new Exception(message);
|
||||
}
|
||||
}
|
||||
@ -104,11 +106,11 @@ namespace SqlSugar
|
||||
catch (Exception ex)
|
||||
{
|
||||
var message = ErrorMessage.GetThrowMessage(
|
||||
"You need to refer to System.Data.SQLite.dll." + ex.Message,
|
||||
"你需要引用System.Data.SQLite.dll,如果有版本兼容问题请先删除原有引用");
|
||||
"You need to refer to Microsoft.Data.Sqlite." + ex.Message,
|
||||
"你需要引用Microsoft.Data.Sqlite,如果有版本兼容问题请先删除原有引用");
|
||||
throw new Exception(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user