mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-25 04:27:14 +08:00
Update Automatic database switching with read-write separation
This commit is contained in:
@@ -403,7 +403,13 @@ namespace SqlSugar
|
||||
ToSqlBefore();
|
||||
sql = QueryBuilder.ToSqlString();
|
||||
sql = QueryBuilder.ToCountSql(sql);
|
||||
var oldIsDisableMasterSlaveSeparation = this.Context.Ado.IsDisableMasterSlaveSeparation;
|
||||
if (this.QueryBuilder.IsDisableMasterSlaveSeparation)
|
||||
{
|
||||
this.Context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||
}
|
||||
var result = Context.Ado.GetInt(sql, QueryBuilder.Parameters.ToArray());
|
||||
this.Context.Ado.IsDisableMasterSlaveSeparation = oldIsDisableMasterSlaveSeparation;
|
||||
return result;
|
||||
}
|
||||
protected async Task<int> GetCountAsync()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugarCore</id>
|
||||
<version>5.1.4.211</version>
|
||||
<version>5.1.4.213-preview04</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>果糖大数据科技</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
||||
Reference in New Issue
Block a user