File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/Common.OData.ApiExplorer/AspNet.OData/Routing Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 99 using Microsoft . OData . Edm ;
1010 using System ;
1111 using System . Collections . Generic ;
12+ using System . ComponentModel . DataAnnotations . Schema ;
1213 using System . Diagnostics . Contracts ;
1314 using System . Linq ;
1415 using System . Reflection ;
@@ -521,12 +522,16 @@ IList<ApiParameterDescription> GetQueryParameters( IList<ApiParameterDescription
521522
522523 static string GetRouteParameterName ( IReadOnlyDictionary < string , ApiParameterDescription > actionParameters , string name )
523524 {
525+ if ( ! actionParameters . TryGetValue ( name , out var parameter ) )
526+ {
527+ return name ;
528+ }
524529#if WEBAPI
525- return actionParameters [ name ] . ParameterDescriptor . ParameterName ;
530+ return parameter . ParameterDescriptor . ParameterName ;
526531#elif API_EXPLORER
527- return actionParameters [ name ] . ParameterDescriptor . Name ;
532+ return parameter . ParameterDescriptor . Name ;
528533#else
529- return actionParameters [ name ] . Name ;
534+ return parameter . Name ;
530535#endif
531536 }
532537
You can’t perform that action at this time.
0 commit comments