Browse Source

Update gobal filter

pull/31/head
sunkaixuan 2 years ago
parent
commit
f824ee7839
  1. 15
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  2. 20
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs
  3. 7
      Src/Asp.Net/SqlSugar/Interface/IQueryable.cs

15
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -272,6 +272,21 @@ namespace SqlSugar
this.Filter(null, true); this.Filter(null, true);
return this; return this;
} }
public ISugarQueryable<T> ClearFilter<FilterType1>()
{
this.ClearFilter(typeof(FilterType1));
return this;
}
public ISugarQueryable<T> ClearFilter<FilterType1, FilterType2>()
{
this.ClearFilter(typeof(FilterType1),typeof(FilterType2));
return this;
}
public ISugarQueryable<T> ClearFilter<FilterType1, FilterType2, FilterType3>()
{
this.ClearFilter(typeof(FilterType1), typeof(FilterType2),typeof(FilterType3));
return this;
}
public ISugarQueryable<T> Filter(Type type) public ISugarQueryable<T> Filter(Type type)
{ {
this.Context.InitMappingInfo(type); this.Context.InitMappingInfo(type);

20
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs

@ -458,6 +458,26 @@ namespace SqlSugar
this.Filter(null, true); this.Filter(null, true);
return this; return this;
} }
public new ISugarQueryable<T,T2> ClearFilter(params Type[] types)
{
base.ClearFilter(types);
return this;
}
public new ISugarQueryable<T, T2> ClearFilter<FilterType1>()
{
this.ClearFilter(typeof(FilterType1));
return this;
}
public new ISugarQueryable<T, T2> ClearFilter<FilterType1, FilterType2>()
{
this.ClearFilter(typeof(FilterType1), typeof(FilterType2));
return this;
}
public new ISugarQueryable<T, T2> ClearFilter<FilterType1, FilterType2, FilterType3>()
{
this.ClearFilter(typeof(FilterType1), typeof(FilterType2), typeof(FilterType3));
return this;
}
public new ISugarQueryable<T, T2> Filter(string FilterName, bool isDisabledGobalFilter = false) public new ISugarQueryable<T, T2> Filter(string FilterName, bool isDisabledGobalFilter = false)
{ {
_Filter(FilterName, isDisabledGobalFilter); _Filter(FilterName, isDisabledGobalFilter);

7
Src/Asp.Net/SqlSugar/Interface/IQueryable.cs

@ -34,6 +34,9 @@ namespace SqlSugar
ISugarQueryable<T, T2> RightJoin<T2>(Expression<Func<T, T2, bool>> joinExpression); ISugarQueryable<T, T2> RightJoin<T2>(Expression<Func<T, T2, bool>> joinExpression);
ISugarQueryable<T> Filter(string FilterName, bool isDisabledGobalFilter = false); ISugarQueryable<T> Filter(string FilterName, bool isDisabledGobalFilter = false);
ISugarQueryable<T> ClearFilter(params Type[] types); ISugarQueryable<T> ClearFilter(params Type[] types);
ISugarQueryable<T> ClearFilter<FilterType1>();
ISugarQueryable<T> ClearFilter<FilterType1,FilterType2>();
ISugarQueryable<T> ClearFilter<FilterType1,FilterType2, FilterType3>();
ISugarQueryable<T> ClearFilter(); ISugarQueryable<T> ClearFilter();
ISugarQueryable<T> Filter(Type type); ISugarQueryable<T> Filter(Type type);
ISugarQueryable<T> Mapper(Action<T> mapperAction); ISugarQueryable<T> Mapper(Action<T> mapperAction);
@ -318,6 +321,10 @@ namespace SqlSugar
new ISugarQueryable<T, T2> AS<AsT>(string tableName); new ISugarQueryable<T, T2> AS<AsT>(string tableName);
new ISugarQueryable<T, T2> AS(string tableName); new ISugarQueryable<T, T2> AS(string tableName);
new ISugarQueryable<T,T2> ClearFilter(); new ISugarQueryable<T,T2> ClearFilter();
new ISugarQueryable<T,T2> ClearFilter(params Type[] types);
new ISugarQueryable<T,T2> ClearFilter<FilterType1>();
new ISugarQueryable<T,T2> ClearFilter<FilterType1, FilterType2>();
new ISugarQueryable<T,T2> ClearFilter<FilterType1, FilterType2, FilterType3>();
new ISugarQueryable<T, T2> Filter(string FilterName, bool isDisabledGobalFilter = false); new ISugarQueryable<T, T2> Filter(string FilterName, bool isDisabledGobalFilter = false);
new ISugarQueryable<T, T2> AddParameters(object parameters); new ISugarQueryable<T, T2> AddParameters(object parameters);
new ISugarQueryable<T, T2> AddParameters(SugarParameter[] parameters); new ISugarQueryable<T, T2> AddParameters(SugarParameter[] parameters);

Loading…
Cancel
Save