Skip to content

Commit 509bdfd

Browse files
Chris Martinezcommonsensesoftware
authored andcommitted
Fix testing for OData controllers to be based on routing method instead of base class
1 parent f08cc8f commit 509bdfd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Common.OData/TypeExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
/// </summary>
1111
static partial class TypeExtensions
1212
{
13-
static readonly TypeInfo ODataController = typeof( ODataController ).GetTypeInfo();
13+
static readonly Type ODataRoutingAttributeType = typeof( ODataRoutingAttribute );
1414
static readonly TypeInfo MetadataController = typeof( MetadataController ).GetTypeInfo();
1515
static readonly Type Delta = typeof( IDelta );
1616
static readonly Type ODataPath = typeof( ODataPath );
1717
static readonly Type ODataQueryOptions = typeof( ODataQueryOptions );
1818
static readonly Type ODataActionParameters = typeof( ODataActionParameters );
1919
static readonly Type ODataParameterHelper = typeof( ODataParameterHelper );
2020

21-
internal static bool IsODataController( this Type controllerType ) => ODataController.IsAssignableFrom( controllerType );
21+
internal static bool IsODataController( this Type controllerType ) => Attribute.IsDefined( controllerType, ODataRoutingAttributeType );
2222

23-
internal static bool IsODataController( this TypeInfo controllerType ) => ODataController.IsAssignableFrom( controllerType );
23+
internal static bool IsODataController( this TypeInfo controllerType ) => Attribute.IsDefined( controllerType, ODataRoutingAttributeType );
2424

2525
internal static bool IsMetadataController( this TypeInfo controllerType ) => MetadataController.IsAssignableFrom( controllerType );
2626

0 commit comments

Comments
 (0)