update tests

This commit is contained in:
28810 2020-04-16 13:13:21 +08:00
parent 7220877590
commit 3f9cfc1491
2 changed files with 9 additions and 9 deletions

View File

@ -26,28 +26,28 @@ namespace FreeSql.Tests
g.sqlite.Delete<dept_user>().Where("1=1").ExecuteAffrows();
BaseEntity.Initialization(g.sqlite);
userinfo user = new userinfo { userid = 1 };
userinfo user = new userinfo { userid = 1, badgenumber = "", Name="", IDCardNo="" };
user.Insert();
user.depts = new List<DEPARTMENTS>(
new[] {
new DEPARTMENTS { deptid = 1, deptcode = "01" },
new DEPARTMENTS { deptid = 2, deptcode = "02" },
new DEPARTMENTS { deptid = 3, deptcode = "03" },
new DEPARTMENTS { deptid = 1, deptcode = "01", deptname = "" },
new DEPARTMENTS { deptid = 2, deptcode = "02", deptname = "" },
new DEPARTMENTS { deptid = 3, deptcode = "03" , deptname = ""},
});
user.SaveMany("depts");
user.depts = new List<DEPARTMENTS>(
new[] {
new DEPARTMENTS { deptid = 1, deptcode = "01" },
new DEPARTMENTS { deptid = 2, deptcode = "02" },
new DEPARTMENTS { deptid = 4, deptcode = "04" },
new DEPARTMENTS { deptid = 1, deptcode = "01", deptname = "" },
new DEPARTMENTS { deptid = 2, deptcode = "02", deptname = "" },
new DEPARTMENTS { deptid = 4, deptcode = "04", deptname = "" },
});
user.SaveMany("depts");
user.depts = new List<DEPARTMENTS>(
new[] {
new DEPARTMENTS { deptid = 2, deptcode = "02" },
new DEPARTMENTS { deptid = 2, deptcode = "02", deptname = "" },
});
user.SaveMany("depts");

View File

@ -71,7 +71,7 @@ namespace FreeSql.SqlServer
Match m = Regex.Match(_connectionString, pattern, RegexOptions.IgnoreCase);
if (m.Success == false || int.TryParse(m.Groups[1].Value, out var poolsize) == false || poolsize <= 0) poolsize = 100;
var connStrIncr = dicConnStrIncr.AddOrUpdate(_connectionString, 1, (oldkey, oldval) => Math.Min(5, oldval + 1));
PoolSize = poolsize +connStrIncr;
PoolSize = poolsize + connStrIncr;
_connectionString = m.Success ?
Regex.Replace(_connectionString, pattern, $"Max pool size={PoolSize}", RegexOptions.IgnoreCase) :
$"{_connectionString};Max pool size={PoolSize}";