File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer
AspNet/WebApi/src/Asp.Versioning.WebApi.ApiExplorer/ApiExplorer Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 22
33namespace Asp . Versioning . ApiExplorer ;
44
5+ using Asp . Versioning . Routing ;
56using System . Web . Http ;
67
78/// <content>
@@ -37,4 +38,10 @@ public partial class ApiExplorerOptions
3738 /// </summary>
3839 /// <value>The <see cref="IApiVersionParameterSource">API version parameter source</see> used to describe API version parameters.</value>
3940 public IApiVersionParameterSource ApiVersionParameterSource => options . Value . ApiVersionReader ;
41+
42+ /// <summary>
43+ /// Gets the name associated with the API version route constraint.
44+ /// </summary>
45+ /// <value>The name associated with the <see cref="ApiVersionRouteConstraint">API version route constraint</see>.</value>
46+ public string RouteConstraintName => options . Value . RouteConstraintName ;
4047}
Original file line number Diff line number Diff line change 22
33namespace Asp . Versioning . ApiExplorer ;
44
5+ using Asp . Versioning . Routing ;
6+
57/// <content>
68/// Provides additional implementation specific to ASP.NET Core.
79/// </content>
@@ -38,4 +40,10 @@ public IApiVersionParameterSource ApiVersionParameterSource
3840 get => parameterSource ??= ApiVersionReader . Combine ( new QueryStringApiVersionReader ( ) , new UrlSegmentApiVersionReader ( ) ) ;
3941 set => parameterSource = value ;
4042 }
43+
44+ /// <summary>
45+ /// Gets or sets the name associated with the API version route constraint.
46+ /// </summary>
47+ /// <value>The name associated with the <see cref="ApiVersionRouteConstraint">API version route constraint</see>.</value>
48+ public string RouteConstraintName { get ; set ; } = string . Empty ;
4149}
Original file line number Diff line number Diff line change @@ -59,9 +59,10 @@ public virtual T Create( string name )
5959 var apiVersioningOptions = Options ;
6060 var options = new T ( )
6161 {
62- DefaultApiVersion = apiVersioningOptions . DefaultApiVersion ,
63- ApiVersionParameterSource = apiVersioningOptions . ApiVersionReader ,
6462 AssumeDefaultVersionWhenUnspecified = apiVersioningOptions . AssumeDefaultVersionWhenUnspecified ,
63+ ApiVersionParameterSource = apiVersioningOptions . ApiVersionReader ,
64+ DefaultApiVersion = apiVersioningOptions . DefaultApiVersion ,
65+ RouteConstraintName = apiVersioningOptions . RouteConstraintName ,
6566 } ;
6667
6768 foreach ( var setup in Setups )
You can’t perform that action at this time.
0 commit comments