mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 调整 移除对 System.ValueType 的依赖,减少版本冲突问题;(目前 FreeSql.dll 无任何公用库依赖)
This commit is contained in:
@ -153,8 +153,19 @@ namespace FreeSql
|
||||
|
||||
public class FluentDataFilter : IDisposable
|
||||
{
|
||||
|
||||
internal List<(Type type, string name, LambdaExpression exp)> _filters = new List<(Type type, string name, LambdaExpression exp)>();
|
||||
internal class FilterInfo
|
||||
{
|
||||
public Type type { get; }
|
||||
public string name { get; }
|
||||
public LambdaExpression exp { get; }
|
||||
public FilterInfo(Type type, string name, LambdaExpression exp)
|
||||
{
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
this.exp = exp;
|
||||
}
|
||||
}
|
||||
internal List<FilterInfo> _filters = new List<FilterInfo>();
|
||||
|
||||
public FluentDataFilter Apply<TEntity>(string filterName, Expression<Func<TEntity, bool>> filterAndValidateExp) where TEntity : class
|
||||
{
|
||||
@ -162,7 +173,7 @@ namespace FreeSql
|
||||
throw new ArgumentNullException(nameof(filterName));
|
||||
if (filterAndValidateExp == null) return this;
|
||||
|
||||
_filters.Add((typeof(TEntity), filterName, filterAndValidateExp));
|
||||
_filters.Add(new FilterInfo(typeof(TEntity), filterName, filterAndValidateExp));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user