using FreeSql; using System; using System.Collections.Generic; namespace Binance.TradeRobot.Business.Extensions { public static class FreeSqlExtension { public static ISelect WithLock(this ISelect that, SqlServerLock lockType = SqlServerLock.NoLock, Dictionary rule = null) where T2 : class where T3 : class { return rule == null ? that.AsAlias((type, old) => $"{old} With({lockType})") : that.AsAlias((type, old) => rule.TryGetValue(type, out var trybool) && trybool ? $"{old} With({lockType.ToString()})" : old); } } }