Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Update ODataStartup.cs to include missing OData query options

support4711ee556f34
diff --git a/src/API/Grand.Api/Infrastructure/ODataStartup.cs b/src/API/Grand.Api/Infrastructure/ODataStartup.cs
index 67c6b8b31..9b9c46169 100644
--- a/src/API/Grand.Api/Infrastructure/ODataStartup.cs
+++ b/src/API/Grand.Api/Infrastructure/ODataStartup.cs
@@ -56,8 +56,8 @@ namespace Grand.Api.Infrastructure
}).AddOData(opt =>
{
opt.EnableQueryFeatures(Configurations.MaxLimit);
- opt.AddRouteComponents(Configurations.ODataRoutePrefix, GetEdmModel(apiConfig));
- opt.Select().Filter().Count();
+ opt.AddRouteComponents(Configurations.ODataRoutePrefix, GetEdmModel(apiConfig));
+ opt.Select().Filter().OrderBy().Expand().Count().SetMaxTop(Configurations.MaxLimit);
});
services.AddScoped<ModelValidationAttribute>();