Skip to content

Commit da9c7ae

Browse files
author
Chris Martinez
committed
Enable global $count query option (even though it shouldn't be needed). Related to #567.
1 parent 494fac2 commit da9c7ae

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

samples/aspnetcore/SwaggerODataSample/Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public void Configure( IApplicationBuilder app, IHostingEnvironment env, Version
8484
// BUG: https://github.com/OData/WebApi/issues/1837
8585
// routeBuilder.SetDefaultODataOptions( new ODataOptions() { UrlKeyDelimiter = Parentheses } );
8686
routeBuilder.ServiceProvider.GetRequiredService<ODataOptions>().UrlKeyDelimiter = Parentheses;
87+
88+
// global odata query options
89+
routeBuilder.Count();
90+
8791
routeBuilder.MapVersionedODataRoutes( "odata", "api", modelBuilder.GetEdmModels() );
8892
} );
8993
app.UseSwagger();

samples/webapi/SwaggerODataWebApiSample/Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace Microsoft.Examples
55
using global::Owin;
66
using Microsoft.AspNet.OData;
77
using Microsoft.AspNet.OData.Builder;
8+
using Microsoft.AspNet.OData.Extensions;
89
using Microsoft.AspNet.OData.Routing;
910
using Microsoft.Examples.Configuration;
1011
using Microsoft.OData;
@@ -53,6 +54,9 @@ public void Configuration( IAppBuilder builder )
5354
};
5455
var models = modelBuilder.GetEdmModels();
5556

57+
// global odata query options
58+
configuration.Count();
59+
5660
// INFO: while you can use both, you should choose only ONE of the following; comment, uncomment, or remove as necessary
5761

5862
// WHEN VERSIONING BY: query string, header, or media type

0 commit comments

Comments
 (0)