Class ApplicationApiVersioningOptions
- Namespace
- ProjectTemplate.Web.Options
- Assembly
- ProjectTemplate.Web.dll
Represents template-level API versioning configuration.
public sealed class ApplicationApiVersioningOptions
- Inheritance
-
ApplicationApiVersioningOptions
- Inherited Members
Fields
SectionName
Configuration section name for API versioning settings.
public const string SectionName = "ProjectTemplate:ApiVersioning"
Field Value
Properties
AssumeDefaultVersionWhenUnspecified
Gets or sets a value indicating whether an unspecified API version should use the default version.
public bool AssumeDefaultVersionWhenUnspecified { get; set; }
Property Value
DefaultMajorVersion
Gets or sets the default major API version.
public int DefaultMajorVersion { get; set; }
Property Value
DefaultMinorVersion
Gets or sets the default minor API version.
public int DefaultMinorVersion { get; set; }
Property Value
DeprecatedVersionSunset
Gets or sets the date a deprecated API version stops being served, advertised as the Sunset header.
public DateTimeOffset? DeprecatedVersionSunset { get; set; }
Property Value
Remarks
Unset by default, and the header is omitted when it is unset. A sunset date is a commitment to the callers of a specific deployment about when a version disappears, so a template cannot supply a meaningful one: any date shipped here is either arbitrary or, once it passes, an advertised removal that already happened. Set this when the application actually deprecates a version, to a date in the future.
EnableHeaderVersioning
Gets or sets a value indicating whether header-based versioning is enabled.
public bool EnableHeaderVersioning { get; set; }
Property Value
EnableUrlSegmentVersioning
Gets or sets a value indicating whether URL segment versioning is enabled.
public bool EnableUrlSegmentVersioning { get; set; }
Property Value
HeaderName
Gets or sets the request header name used for header-based API versioning.
public string HeaderName { get; set; }
Property Value
ReportApiVersions
Gets or sets a value indicating whether supported and deprecated API versions should be reported in response headers.
public bool ReportApiVersions { get; set; }