- 移除 ISelect<T> where T : class 约束限制;#515

This commit is contained in:
2881099
2020-11-02 21:01:07 +08:00
parent 5580602a19
commit f3bc47feca
92 changed files with 497 additions and 860 deletions

View File

@ -30,7 +30,7 @@ public static partial class FreeSqlSqlServerGlobalExtensions
/// <param name="lockType"></param>
/// <param name="rule">多表查询时的锁规则</param>
/// <returns></returns>
public static ISelect<T> WithLock<T>(this ISelect<T> that, SqlServerLock lockType = SqlServerLock.NoLock, Dictionary<Type, bool> rule = null) where T : class
public static ISelect<T> WithLock<T>(this ISelect<T> that, SqlServerLock lockType = SqlServerLock.NoLock, Dictionary<Type, bool> rule = null)
=> rule == null ?
that.AsAlias((type, old) => $"{old} With({lockType.ToString()})") :
that.AsAlias((type, old) => rule.TryGetValue(type, out var trybool) && trybool ? $"{old} With({lockType.ToString()})" : old);