better without.
This commit is contained in:
parent
3985530dbe
commit
a614b3afb3
@ -8,7 +8,6 @@ namespace PoweredSoft.DynamicQuery.Cli
|
|||||||
public class PersonQueryInterceptor : IQueryInterceptor
|
public class PersonQueryInterceptor : IQueryInterceptor
|
||||||
//, IBeforeQueryAlteredInterceptor<Person>
|
//, IBeforeQueryAlteredInterceptor<Person>
|
||||||
//, IFilterInterceptor
|
//, IFilterInterceptor
|
||||||
, IFilterInterceptor<Person>
|
|
||||||
{
|
{
|
||||||
public IQueryable<Person> InterceptQueryBeforeAltered(IQueryCriteria criteria, IQueryable<Person> queryable)
|
public IQueryable<Person> InterceptQueryBeforeAltered(IQueryCriteria criteria, IQueryable<Person> queryable)
|
||||||
=> queryable.Where(t => t.FirstName.StartsWith("Da"));
|
=> queryable.Where(t => t.FirstName.StartsWith("Da"));
|
||||||
@ -39,11 +38,6 @@ namespace PoweredSoft.DynamicQuery.Cli
|
|||||||
|
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IFilter InterceptFilter<T>(IFilter filter)
|
|
||||||
{
|
|
||||||
return InterceptFilter(filter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Person
|
public class Person
|
||||||
@ -53,6 +47,11 @@ namespace PoweredSoft.DynamicQuery.Cli
|
|||||||
public string LastName { get; set; }
|
public string LastName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class OtherClass
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
|
@ -6,9 +6,4 @@ namespace PoweredSoft.DynamicQuery.Core
|
|||||||
{
|
{
|
||||||
IFilter InterceptFilter(IFilter filter);
|
IFilter InterceptFilter(IFilter filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IFilterInterceptor<T> : IQueryInterceptor
|
|
||||||
{
|
|
||||||
IFilter InterceptFilter<T>(IFilter filter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -92,10 +92,6 @@ namespace PoweredSoft.DynamicQuery
|
|||||||
.Cast<IFilterInterceptor>()
|
.Cast<IFilterInterceptor>()
|
||||||
.Aggregate(filter, (previousFilter, interceptor) => interceptor.InterceptFilter(previousFilter));
|
.Aggregate(filter, (previousFilter, interceptor) => interceptor.InterceptFilter(previousFilter));
|
||||||
|
|
||||||
ret = Interceptors.Where(t => t is IFilterInterceptor<T>)
|
|
||||||
.Cast<IFilterInterceptor<T>>()
|
|
||||||
.Aggregate(filter, (previousFilter, interceptor) => interceptor.InterceptFilter<T>(previousFilter));
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user