- 修复 MySql + InsertOrUpdateDict + IfExistsDoNothing 错误;#1601

This commit is contained in:
2881099
2023-08-24 11:20:19 +08:00
parent 3ab8bb5ec6
commit dd1f64a772
6 changed files with 57 additions and 44 deletions

View File

@ -559,7 +559,7 @@ namespace base_entity
//.UseConnectionString(FreeSql.DataType.Firebird, @"database=localhost:D:\fbdata\EXAMPLES.fdb;user=sysdba;password=123456;max pool size=5")
//.UseQuoteSqlName(false)
.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;min pool size=1;Max pool size=3;AllowLoadLocalInfile=true")
//.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;min pool size=1;Max pool size=3;AllowLoadLocalInfile=true")
//.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3;TrustServerCertificate=true")
@ -600,6 +600,14 @@ namespace base_entity
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
#endregion
var dict = new List<Dictionary<string, object>>();
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("id", 1);
d.Add("name", "name1");
dict.Add(d);
var testx01 = fsql.InsertOrUpdateDict(dict).AsTable("table222zzz").WherePrimary("id").IfExistsDoNothing().ToSql();
fsql.InsertOrUpdateDict(dict).AsTable("table222zzz").WherePrimary("id").IfExistsDoNothing().ExecuteAffrows();
var xxxc1 = User1.Select.ToSql(a => new
{
count = User1.Where(b => b.Id == a.Id).Count()