File tree 3 files changed +18
-2
lines changed
AspNet/WebApi/src/Asp.Versioning.WebApi.ApiExplorer/ApiExplorer
AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Asp . Versioning . ApiExplorer ;
4
4
5
+ using Asp . Versioning . Routing ;
5
6
using System . Web . Http ;
6
7
7
8
/// <content>
@@ -37,4 +38,10 @@ public partial class ApiExplorerOptions
37
38
/// </summary>
38
39
/// <value>The <see cref="IApiVersionParameterSource">API version parameter source</see> used to describe API version parameters.</value>
39
40
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 ;
40
47
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace Asp . Versioning . ApiExplorer ;
4
4
5
+ using Asp . Versioning . Routing ;
6
+
5
7
/// <content>
6
8
/// Provides additional implementation specific to ASP.NET Core.
7
9
/// </content>
@@ -38,4 +40,10 @@ public IApiVersionParameterSource ApiVersionParameterSource
38
40
get => parameterSource ??= ApiVersionReader . Combine ( new QueryStringApiVersionReader ( ) , new UrlSegmentApiVersionReader ( ) ) ;
39
41
set => parameterSource = value ;
40
42
}
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 ;
41
49
}
Original file line number Diff line number Diff line change @@ -59,9 +59,10 @@ public virtual T Create( string name )
59
59
var apiVersioningOptions = Options ;
60
60
var options = new T ( )
61
61
{
62
- DefaultApiVersion = apiVersioningOptions . DefaultApiVersion ,
63
- ApiVersionParameterSource = apiVersioningOptions . ApiVersionReader ,
64
62
AssumeDefaultVersionWhenUnspecified = apiVersioningOptions . AssumeDefaultVersionWhenUnspecified ,
63
+ ApiVersionParameterSource = apiVersioningOptions . ApiVersionReader ,
64
+ DefaultApiVersion = apiVersioningOptions . DefaultApiVersion ,
65
+ RouteConstraintName = apiVersioningOptions . RouteConstraintName ,
65
66
} ;
66
67
67
68
foreach ( var setup in Setups )
You can’t perform that action at this time.
0 commit comments