File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
src/EntityFramework.DynamicFilters.Shared Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ public class DynamicFilterInterceptor : IDbCommandTreeInterceptor
1111 {
1212 public void TreeCreated ( DbCommandTreeInterceptionContext interceptionContext )
1313 {
14+ // https://github.com/zzzprojects/EntityFramework.DynamicFilters/issues/153
15+ if ( DynamicFilterManager . ShouldIgnoreDynamicFilterInterceptor != null && DynamicFilterManager . ShouldIgnoreDynamicFilterInterceptor ( interceptionContext ) ) return ;
16+
1417 var queryCommand = interceptionContext . Result as DbQueryCommandTree ;
1518 if ( queryCommand != null )
1619 {
1720 var context = interceptionContext . DbContexts . FirstOrDefault ( ) ;
1821 if ( context != null )
1922 {
20- // https://github.com/zzzprojects/EntityFramework.DynamicFilters/issues/153
21- if ( context is HistoryContext ) return ;
22-
2323 DbExpressionVisitor < DbExpression > visitor ;
2424#if ( USE_CSPACE )
2525 // Intercepting CSpace instead of SSpace gives us access to all of the navigation properties
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Data . Entity . Infrastructure . Interception ;
3+
4+ namespace EntityFramework . DynamicFilters
5+ {
6+ /// <summary>Manager for dynamic filters.</summary>
7+ public static class DynamicFilterManager
8+ {
9+ /// <summary>
10+ /// Gets or sets if the DynamicFilterInterceptor should be ignored.
11+ /// </summary>
12+ /// <value>True if the DynamicFilterInterceptor should be ignored.</value>
13+ public static Func < DbCommandTreeInterceptionContext , bool > ShouldIgnoreDynamicFilterInterceptor { get ; set ; }
14+ }
15+ }
Original file line number Diff line number Diff line change 1515 <Compile Include =" $(MSBuildThisFileDirectory)DynamicFilterDefinition.cs" />
1616 <Compile Include =" $(MSBuildThisFileDirectory)DynamicFilterExtensions.cs" />
1717 <Compile Include =" $(MSBuildThisFileDirectory)DynamicFilterInterceptor.cs" />
18+ <Compile Include =" $(MSBuildThisFileDirectory)DynamicFilterManager.cs" />
1819 <Compile Include =" $(MSBuildThisFileDirectory)DynamicFilterOptions.cs" />
1920 <Compile Include =" $(MSBuildThisFileDirectory)DynamicFilterParameters.cs" />
2021 <Compile Include =" $(MSBuildThisFileDirectory)DynamicFilterQueryVisitorCSpace.cs" />
You can’t perform that action at this time.
0 commit comments