Skip to content

Commit

Permalink
- 优化 WithLock/WithIndex 非 SqlServer 时忽略;
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Aug 22, 2023
1 parent 3605046 commit 3ab8bb5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Providers/FreeSql.Provider.SqlServer/SqlServerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ public static partial class FreeSqlSqlServerGlobalExtensions
static TReturn LocalWithLock<TReturn>(TReturn query, SqlServerLock lockType, Dictionary<Type, bool> rule)
{
var selectProvider = query as Select0Provider;
switch (selectProvider._orm.Ado.DataType)
{
case DataType.SqlServer:
case DataType.OdbcSqlServer:
case DataType.CustomSqlServer:
break;
default:
return query;
}
var oldalias = selectProvider._aliasRule;
selectProvider._aliasRule = (type, old) =>
{
Expand Down Expand Up @@ -93,6 +102,15 @@ static TReturn LocalWithIndex<TReturn>(TReturn query, string indexName, Dictiona
{
if (string.IsNullOrWhiteSpace(indexName)) return query;
var selectProvider = query as Select0Provider;
switch (selectProvider._orm.Ado.DataType)
{
case DataType.SqlServer:
case DataType.OdbcSqlServer:
case DataType.CustomSqlServer:
break;
default:
return query;
}
var oldalias = selectProvider._aliasRule;
selectProvider._aliasRule = (type, old) =>
{
Expand Down

0 comments on commit 3ab8bb5

Please sign in to comment.