Files
coreshoppro/CoreCms.Net.Repository/SqlSugarExtensions.cs
jianweie code 373198e1bf 【修复】修复后台支付单生成校验失败的问题。
【优化】新增SqlSugarExtensions扩展类,增加是否使用WITH(NoLock)方法扩展封装,删除BaseRepository中的一些冗余代码。
2023-05-07 23:10:41 +08:00

20 lines
379 B
C#

using SqlSugar;
namespace CoreCms.Net.Repository
{
internal static class SqlSugarExtensions
{
internal static ISugarQueryable<T> WithNoLockOrNot<T>(this ISugarQueryable<T> query, bool @lock = false)
{
if (@lock)
{
query = query.With(SqlWith.NoLock);
}
return query;
}
}
}