Skip to content

Commit d54eade

Browse files
committed
- 调整 私有方法 GlobalFilter.Apply 命名为 ApplyCore;#2061
1 parent 63056e2 commit d54eade

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

FreeSql/Internal/GlobalFilter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class Item
3939
/// <param name="where">表达式</param>
4040
/// <param name="before">条件在最前面</param>
4141
/// <returns></returns>
42-
public GlobalFilter Apply<TEntity>(string name, Expression<Func<TEntity, bool>> where, bool before = false) => Apply(false, name, () => true, where, before);
42+
public GlobalFilter Apply<TEntity>(string name, Expression<Func<TEntity, bool>> where, bool before = false) => ApplyCore(false, name, () => true, where, before);
4343
/// <summary>
4444
/// 创建一个动态过滤器,当 condition 返回值为 true 时才生效<para></para>
4545
/// 场景:当登陆身份是管理员,则过滤条件不生效<para></para>
@@ -51,7 +51,7 @@ public class Item
5151
/// <param name="where">表达式</param>
5252
/// <param name="before">条件在最前面</param>
5353
/// <returns></returns>
54-
public GlobalFilter ApplyIf<TEntity>(string name, Func<bool> condition, Expression<Func<TEntity, bool>> where, bool before = false) => Apply(false, name, condition, where, before);
54+
public GlobalFilter ApplyIf<TEntity>(string name, Func<bool> condition, Expression<Func<TEntity, bool>> where, bool before = false) => ApplyCore(false, name, condition, where, before);
5555

5656
/// <summary>
5757
/// 创建一个过滤器(实体类型 属于指定 TEntity 才会生效)<para></para>
@@ -62,7 +62,7 @@ public class Item
6262
/// <param name="where">表达式</param>
6363
/// <param name="before">条件在最前面</param>
6464
/// <returns></returns>
65-
public GlobalFilter ApplyOnly<TEntity>(string name, Expression<Func<TEntity, bool>> where, bool before = false) => Apply(true, name, () => true, where, before);
65+
public GlobalFilter ApplyOnly<TEntity>(string name, Expression<Func<TEntity, bool>> where, bool before = false) => ApplyCore(true, name, () => true, where, before);
6666
/// <summary>
6767
/// 创建一个过滤器(实体类型 属于指定 TEntity 才会生效)<para></para>
6868
/// 场景:当登陆身份是管理员,则过滤条件不生效<para></para>
@@ -74,9 +74,9 @@ public class Item
7474
/// <param name="where">表达式</param>
7575
/// <param name="before">条件在最前面</param>
7676
/// <returns></returns>
77-
public GlobalFilter ApplyOnlyIf<TEntity>(string name, Func<bool> condition, Expression<Func<TEntity, bool>> where, bool before = false) => Apply(true, name, condition, where, before);
77+
public GlobalFilter ApplyOnlyIf<TEntity>(string name, Func<bool> condition, Expression<Func<TEntity, bool>> where, bool before = false) => ApplyCore(true, name, condition, where, before);
7878

79-
GlobalFilter Apply<TEntity>(bool only, string name, Func<bool> condition, Expression<Func<TEntity, bool>> where, bool before, FilterType filterType = FilterType.Query | FilterType.Update | FilterType.Delete)
79+
public GlobalFilter ApplyCore<TEntity>(bool only, string name, Func<bool> condition, Expression<Func<TEntity, bool>> where, bool before, FilterType filterType = FilterType.Query | FilterType.Update | FilterType.Delete)
8080
{
8181
if (name == null) throw new ArgumentNullException(nameof(name));
8282
if (where == null) return this;

0 commit comments

Comments
 (0)