Skip to content

Commit 70675d7

Browse files
Chris Martinezcommonsensesoftware
authored andcommitted
Update examples with latest language features
1 parent 1836ba7 commit 70675d7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

samples/aspnetcore/ConventionsSample/Startup.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ public void ConfigureServices( IServiceCollection services )
3030
// reporting api versions will return the headers "api-supported-versions" and "api-deprecated-versions"
3131
options.ReportApiVersions = true;
3232

33-
// apply api versions using conventions rather than attributes
3433
options.Conventions.Controller<ValuesController>().HasApiVersion( 1, 0 );
34+
3535
options.Conventions.Controller<Values2Controller>()
3636
.HasApiVersion( 2, 0 )
3737
.HasApiVersion( 3, 0 )
38-
.Action( c => c.GetV3( default( ApiVersion ) ) ).MapToApiVersion( 3, 0 )
39-
.Action( c => c.GetV3( default( int ), default( ApiVersion ) ) ).MapToApiVersion( 3, 0 );
38+
.Action( c => c.GetV3( default ) ).MapToApiVersion( 3, 0 )
39+
.Action( c => c.GetV3( default, default ) ).MapToApiVersion( 3, 0 );
40+
4041
options.Conventions.Controller<HelloWorldController>()
4142
.HasApiVersion( 1, 0 )
4243
.HasApiVersion( 2, 0 )

samples/aspnetcore/SwaggerODataSample/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public void ConfigureServices( IServiceCollection services )
4444

4545
// configure query options (which cannot otherwise be configured by OData conventions)
4646
options.QueryOptions.Controller<V2.PeopleController>()
47-
.Action( c => c.Get( default( ODataQueryOptions<Person> ) ) ).Allow( Skip | Count ).AllowTop( 100 );
47+
.Action( c => c.Get( default ) ).Allow( Skip | Count ).AllowTop( 100 );
4848

4949
options.QueryOptions.Controller<V3.PeopleController>()
50-
.Action( c => c.Get( default( ODataQueryOptions<Person> ) ) ).Allow( Skip | Count ).AllowTop( 100 );
50+
.Action( c => c.Get( default ) ).Allow( Skip | Count ).AllowTop( 100 );
5151
} );
5252
services.AddSwaggerGen(
5353
options =>

0 commit comments

Comments
 (0)