mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Update db.QueryFilter
This commit is contained in:
parent
c08dd4bf0f
commit
cfc1c4f28d
@ -65,31 +65,35 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTableFilter<T>(Expression<Func<T,bool>> expression, FilterJoinPosition filterJoinType = FilterJoinPosition.On) where T : class,new()
|
public QueryFilterProvider AddTableFilter<T>(Expression<Func<T,bool>> expression, FilterJoinPosition filterJoinType = FilterJoinPosition.On) where T : class,new()
|
||||||
{
|
{
|
||||||
var isOn = filterJoinType == FilterJoinPosition.On;
|
var isOn = filterJoinType == FilterJoinPosition.On;
|
||||||
var tableFilter = new TableFilterItem<T>(expression, isOn);
|
var tableFilter = new TableFilterItem<T>(expression, isOn);
|
||||||
this.Add(tableFilter);
|
this.Add(tableFilter);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
public void AddTableFilterIF<T>(bool isAppendFilter,Expression<Func<T, bool>> expression, FilterJoinPosition filterJoinType = FilterJoinPosition.On) where T : class, new()
|
public QueryFilterProvider AddTableFilterIF<T>(bool isAppendFilter,Expression<Func<T, bool>> expression, FilterJoinPosition filterJoinType = FilterJoinPosition.On) where T : class, new()
|
||||||
{
|
{
|
||||||
if (isAppendFilter)
|
if (isAppendFilter)
|
||||||
{
|
{
|
||||||
AddTableFilter(expression, filterJoinType);
|
AddTableFilter(expression, filterJoinType);
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
public void AddTableFilter(Type type,Expression expression, FilterJoinPosition filterJoinType = FilterJoinPosition.On)
|
public QueryFilterProvider AddTableFilter(Type type,Expression expression, FilterJoinPosition filterJoinType = FilterJoinPosition.On)
|
||||||
{
|
{
|
||||||
var isOn = filterJoinType == FilterJoinPosition.On;
|
var isOn = filterJoinType == FilterJoinPosition.On;
|
||||||
this.Add(new TableFilterItem<object>(type, expression, isOn));
|
this.Add(new TableFilterItem<object>(type, expression, isOn));
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTableFilterIF(bool isAppendFilter, Type type, Expression expression, FilterJoinPosition posType = FilterJoinPosition.On)
|
public QueryFilterProvider AddTableFilterIF(bool isAppendFilter, Type type, Expression expression, FilterJoinPosition posType = FilterJoinPosition.On)
|
||||||
{
|
{
|
||||||
if (isAppendFilter)
|
if (isAppendFilter)
|
||||||
{
|
{
|
||||||
AddTableFilter(type, expression, posType);
|
AddTableFilter(type, expression, posType);
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
public enum FilterJoinPosition
|
public enum FilterJoinPosition
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user