File tree 1 file changed +8
-3
lines changed
src/Common.OData.ApiExplorer/AspNet.OData/Routing
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 9
9
using Microsoft . OData . Edm ;
10
10
using System ;
11
11
using System . Collections . Generic ;
12
+ using System . ComponentModel . DataAnnotations . Schema ;
12
13
using System . Diagnostics . Contracts ;
13
14
using System . Linq ;
14
15
using System . Reflection ;
@@ -521,12 +522,16 @@ IList<ApiParameterDescription> GetQueryParameters( IList<ApiParameterDescription
521
522
522
523
static string GetRouteParameterName ( IReadOnlyDictionary < string , ApiParameterDescription > actionParameters , string name )
523
524
{
525
+ if ( ! actionParameters . TryGetValue ( name , out var parameter ) )
526
+ {
527
+ return name ;
528
+ }
524
529
#if WEBAPI
525
- return actionParameters [ name ] . ParameterDescriptor . ParameterName ;
530
+ return parameter . ParameterDescriptor . ParameterName ;
526
531
#elif API_EXPLORER
527
- return actionParameters [ name ] . ParameterDescriptor . Name ;
532
+ return parameter . ParameterDescriptor . Name ;
528
533
#else
529
- return actionParameters [ name ] . Name ;
534
+ return parameter . Name ;
530
535
#endif
531
536
}
532
537
You can’t perform that action at this time.
0 commit comments