File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
src/AspNetCore/OData/src/Asp.Versioning.OData Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 33namespace Asp . Versioning . ApplicationModels ;
44
55using Microsoft . AspNetCore . Mvc . ApplicationModels ;
6+ using Microsoft . AspNetCore . OData . Edm ;
67using Microsoft . AspNetCore . OData . Routing . Attributes ;
78
89/// <summary>
@@ -16,7 +17,7 @@ public bool IsSatisfiedBy( ControllerModel controller )
1617 {
1718 ArgumentNullException . ThrowIfNull ( controller ) ;
1819
19- if ( ODataControllerSpecification . IsSatisfiedBy ( controller ) )
20+ if ( Matches ( controller ) )
2021 {
2122 return true ;
2223 }
@@ -25,7 +26,7 @@ public bool IsSatisfiedBy( ControllerModel controller )
2526
2627 for ( var i = 0 ; i < actions . Count ; i ++ )
2728 {
28- if ( IsSatisfiedBy ( actions [ i ] ) )
29+ if ( Matches ( actions [ i ] ) )
2930 {
3031 return true ;
3132 }
@@ -34,7 +35,7 @@ public bool IsSatisfiedBy( ControllerModel controller )
3435 return false ;
3536 }
3637
37- internal static bool IsSatisfiedBy ( ICommonModel model )
38+ internal static bool Matches ( ICommonModel model )
3839 {
3940 var attributes = model . Attributes ;
4041
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ private static
7979 CollateApiVersions ( ApplicationModel application )
8080 {
8181 var controllers = application . Controllers ;
82+ var specification = new ODataControllerSpecification ( ) ;
8283 var metadataControllers = default ( List < ControllerModel > ) ;
8384 var supported = default ( SortedSet < ApiVersion > ) ;
8485 var deprecated = default ( SortedSet < ApiVersion > ) ;
@@ -93,7 +94,7 @@ private static
9394 metadataControllers . Add ( controller ) ;
9495 continue ;
9596 }
96- else if ( ! ODataControllerSpecification . IsSatisfiedBy ( controller ) )
97+ else if ( ! specification . IsSatisfiedBy ( controller ) )
9798 {
9899 continue ;
99100 }
Original file line number Diff line number Diff line change @@ -95,12 +95,12 @@ public override bool AppliesToAction( ODataControllerActionContext context )
9595
9696 private static bool IsODataController ( ODataControllerActionContext context )
9797 {
98- if ( ODataControllerSpecification . IsSatisfiedBy ( context . Controller ) )
98+ if ( ODataControllerSpecification . Matches ( context . Controller ) )
9999 {
100100 return true ;
101101 }
102102
103- return ODataControllerSpecification . IsSatisfiedBy ( context . Action ) ;
103+ return ODataControllerSpecification . Matches ( context . Action ) ;
104104 }
105105
106106 private static IEdmModel ? FindModel ( ODataControllerActionContext context )
You can’t perform that action at this time.
0 commit comments