This commit is contained in:
skx 2020-12-29 21:32:18 +08:00
parent 8c9c3703ee
commit 5f222f57eb
3 changed files with 8 additions and 5 deletions

View File

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

View File

@ -64,7 +64,10 @@ namespace OrmTest
var result71 = db.Updateable<Order>().SetColumns(it => new Order() { Name = "a", CreateTime = DateTime.Now }).Where(it => it.Id == 11).ExecuteCommand(); var result71 = db.Updateable<Order>().SetColumns(it => new Order() { Name = "a", CreateTime = DateTime.Now }).Where(it => it.Id == 11).ExecuteCommand();
//only update name //only update name
var result8 = db.Updateable<Order>(it => it.Name == "Name").Where(it => it.Id == 1).ExecuteCommand(); var result8 = db.Updateable<Order>(it => it.Name == "Name").Where(it => it.Id == 1).ExecuteCommand();
var result81 = db.Updateable<Order>().SetColumns(it => it.Name == "Name" ).Where(it => it.Id == 1).ExecuteCommand(); var result81 = db.Updateable<Order>()
.SetColumns(it => it.Name == "Name" )
.SetColumns(it => it.CreateTime == DateTime.Now)
.Where(it => it.Id == 1).ExecuteCommand();
// //

View File

@ -129,7 +129,7 @@ namespace SqlSugar
if (this.Value != null) if (this.Value != null)
this.Value = this.Value.ToString(); this.Value = this.Value.ToString();
} }
else if (type.IsEnum()) else if (type!=null&&type.IsEnum())
{ {
this.DbType = System.Data.DbType.Int64; this.DbType = System.Data.DbType.Int64;
} }