mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
update tests
This commit is contained in:
parent
7220877590
commit
3f9cfc1491
@ -26,28 +26,28 @@ namespace FreeSql.Tests
|
|||||||
g.sqlite.Delete<dept_user>().Where("1=1").ExecuteAffrows();
|
g.sqlite.Delete<dept_user>().Where("1=1").ExecuteAffrows();
|
||||||
BaseEntity.Initialization(g.sqlite);
|
BaseEntity.Initialization(g.sqlite);
|
||||||
|
|
||||||
userinfo user = new userinfo { userid = 1 };
|
userinfo user = new userinfo { userid = 1, badgenumber = "", Name="", IDCardNo="" };
|
||||||
user.Insert();
|
user.Insert();
|
||||||
|
|
||||||
user.depts = new List<DEPARTMENTS>(
|
user.depts = new List<DEPARTMENTS>(
|
||||||
new[] {
|
new[] {
|
||||||
new DEPARTMENTS { deptid = 1, deptcode = "01" },
|
new DEPARTMENTS { deptid = 1, deptcode = "01", deptname = "" },
|
||||||
new DEPARTMENTS { deptid = 2, deptcode = "02" },
|
new DEPARTMENTS { deptid = 2, deptcode = "02", deptname = "" },
|
||||||
new DEPARTMENTS { deptid = 3, deptcode = "03" },
|
new DEPARTMENTS { deptid = 3, deptcode = "03" , deptname = ""},
|
||||||
});
|
});
|
||||||
user.SaveMany("depts");
|
user.SaveMany("depts");
|
||||||
|
|
||||||
user.depts = new List<DEPARTMENTS>(
|
user.depts = new List<DEPARTMENTS>(
|
||||||
new[] {
|
new[] {
|
||||||
new DEPARTMENTS { deptid = 1, deptcode = "01" },
|
new DEPARTMENTS { deptid = 1, deptcode = "01", deptname = "" },
|
||||||
new DEPARTMENTS { deptid = 2, deptcode = "02" },
|
new DEPARTMENTS { deptid = 2, deptcode = "02", deptname = "" },
|
||||||
new DEPARTMENTS { deptid = 4, deptcode = "04" },
|
new DEPARTMENTS { deptid = 4, deptcode = "04", deptname = "" },
|
||||||
});
|
});
|
||||||
user.SaveMany("depts");
|
user.SaveMany("depts");
|
||||||
|
|
||||||
user.depts = new List<DEPARTMENTS>(
|
user.depts = new List<DEPARTMENTS>(
|
||||||
new[] {
|
new[] {
|
||||||
new DEPARTMENTS { deptid = 2, deptcode = "02" },
|
new DEPARTMENTS { deptid = 2, deptcode = "02", deptname = "" },
|
||||||
});
|
});
|
||||||
user.SaveMany("depts");
|
user.SaveMany("depts");
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ namespace FreeSql.SqlServer
|
|||||||
Match m = Regex.Match(_connectionString, pattern, RegexOptions.IgnoreCase);
|
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;
|
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));
|
var connStrIncr = dicConnStrIncr.AddOrUpdate(_connectionString, 1, (oldkey, oldval) => Math.Min(5, oldval + 1));
|
||||||
PoolSize = poolsize +connStrIncr;
|
PoolSize = poolsize + connStrIncr;
|
||||||
_connectionString = m.Success ?
|
_connectionString = m.Success ?
|
||||||
Regex.Replace(_connectionString, pattern, $"Max pool size={PoolSize}", RegexOptions.IgnoreCase) :
|
Regex.Replace(_connectionString, pattern, $"Max pool size={PoolSize}", RegexOptions.IgnoreCase) :
|
||||||
$"{_connectionString};Max pool size={PoolSize}";
|
$"{_connectionString};Max pool size={PoolSize}";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user