File tree Expand file tree Collapse file tree 7 files changed +14
-20
lines changed
OpenApiODataWebApiExample
SomeOpenApiODataWebApiExample
WebApi/OpenApiWebApiExample Expand file tree Collapse file tree 7 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,9 @@ public void Configuration( IAppBuilder builder )
119119 description . Append ( " This API version has been deprecated." ) ;
120120 }
121121
122- if ( group . SunsetPolicy is SunsetPolicy policy )
122+ if ( group . SunsetPolicy is { } policy )
123123 {
124- if ( policy . Date is DateTimeOffset when )
124+ if ( policy . Date is { } when )
125125 {
126126 description . Append ( " The API will be sunset on " )
127127 . Append ( when . Date . ToShortDateString ( ) )
Original file line number Diff line number Diff line change 11namespace ApiVersioning . Examples ;
22
3- using Asp . Versioning ;
43using Asp . Versioning . Conventions ;
54using Microsoft . AspNet . OData . Extensions ;
65using Microsoft . Extensions . Primitives ;
@@ -93,9 +92,9 @@ public void Configuration( IAppBuilder builder )
9392 description . Append ( " This API version has been deprecated." ) ;
9493 }
9594
96- if ( group . SunsetPolicy is SunsetPolicy policy )
95+ if ( group . SunsetPolicy is { } policy )
9796 {
98- if ( policy . Date is DateTimeOffset when )
97+ if ( policy . Date is { } when )
9998 {
10099 description . Append ( " The API will be sunset on " )
101100 . Append ( when . Date . ToShortDateString ( ) )
Original file line number Diff line number Diff line change 1111using System . Web . Http ;
1212using System . Web . Http . Description ;
1313using System . Web . Http . Routing ;
14- using static System . Net . Mime . MediaTypeNames ;
1514
1615/// <summary>
1716/// Represents the startup process for the application.
@@ -77,9 +76,9 @@ public void Configuration( IAppBuilder builder )
7776 description . Append ( " This API version has been deprecated." ) ;
7877 }
7978
80- if ( group . SunsetPolicy is SunsetPolicy policy )
79+ if ( group . SunsetPolicy is { } policy )
8180 {
82- if ( policy . Date is DateTimeOffset when )
81+ if ( policy . Date is { } when )
8382 {
8483 description . Append ( " The API will be sunset on " )
8584 . Append ( when . Date . ToShortDateString ( ) )
Original file line number Diff line number Diff line change 11namespace ApiVersioning . Examples ;
22
3- using Asp . Versioning ;
43using Asp . Versioning . ApiExplorer ;
54using Microsoft . Extensions . DependencyInjection ;
65using Microsoft . Extensions . Options ;
@@ -51,9 +50,9 @@ private static OpenApiInfo CreateInfoForApiVersion( ApiVersionDescription descri
5150 text . Append ( " This API version has been deprecated." ) ;
5251 }
5352
54- if ( description . SunsetPolicy is SunsetPolicy policy )
53+ if ( description . SunsetPolicy is { } policy )
5554 {
56- if ( policy . Date is DateTimeOffset when )
55+ if ( policy . Date is { } when )
5756 {
5857 text . Append ( " The API will be sunset on " )
5958 . Append ( when . Date . ToShortDateString ( ) )
Original file line number Diff line number Diff line change 11namespace ApiVersioning . Examples ;
22
3- using Asp . Versioning ;
43using Asp . Versioning . ApiExplorer ;
54using Microsoft . Extensions . DependencyInjection ;
65using Microsoft . Extensions . Options ;
@@ -51,9 +50,9 @@ private static OpenApiInfo CreateInfoForApiVersion( ApiVersionDescription descri
5150 text . Append ( " This API version has been deprecated." ) ;
5251 }
5352
54- if ( description . SunsetPolicy is SunsetPolicy policy )
53+ if ( description . SunsetPolicy is { } policy )
5554 {
56- if ( policy . Date is DateTimeOffset when )
55+ if ( policy . Date is { } when )
5756 {
5857 text . Append ( " The API will be sunset on " )
5958 . Append ( when . Date . ToShortDateString ( ) )
Original file line number Diff line number Diff line change 11namespace ApiVersioning . Examples ;
22
3- using Asp . Versioning ;
43using Asp . Versioning . ApiExplorer ;
54using Microsoft . Extensions . DependencyInjection ;
65using Microsoft . Extensions . Options ;
@@ -51,9 +50,9 @@ private static OpenApiInfo CreateInfoForApiVersion( ApiVersionDescription descri
5150 text . Append ( " This API version has been deprecated." ) ;
5251 }
5352
54- if ( description . SunsetPolicy is SunsetPolicy policy )
53+ if ( description . SunsetPolicy is { } policy )
5554 {
56- if ( policy . Date is DateTimeOffset when )
55+ if ( policy . Date is { } when )
5756 {
5857 text . Append ( " The API will be sunset on " )
5958 . Append ( when . Date . ToShortDateString ( ) )
Original file line number Diff line number Diff line change 11namespace ApiVersioning . Examples ;
22
3- using Asp . Versioning ;
43using Asp . Versioning . ApiExplorer ;
54using Microsoft . Extensions . DependencyInjection ;
65using Microsoft . Extensions . Options ;
@@ -51,9 +50,9 @@ private static OpenApiInfo CreateInfoForApiVersion( ApiVersionDescription descri
5150 text . Append ( " This API version has been deprecated." ) ;
5251 }
5352
54- if ( description . SunsetPolicy is SunsetPolicy policy )
53+ if ( description . SunsetPolicy is { } policy )
5554 {
56- if ( policy . Date is DateTimeOffset when )
55+ if ( policy . Date is { } when )
5756 {
5857 text . Append ( " The API will be sunset on " )
5958 . Append ( when . Date . ToShortDateString ( ) )
You can’t perform that action at this time.
0 commit comments