From 3141309cd46067329892f06073b14e4544b2da34 Mon Sep 17 00:00:00 2001 From: Sam Xu Date: Tue, 9 Jun 2020 11:51:23 -0700 Subject: [PATCH] Set the default of MaxTop to null --- .../Query/DefaultQuerySettings.cs | 2 +- .../Query/ModelBoundQuerySettings.cs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs b/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs index 67685a2826..8204c3a55b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.OData.Query /// public class DefaultQuerySettings { - private int? _maxTop = 0; + private int? _maxTop; /// /// Gets or sets a value indicating whether navigation property can be expanded. diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs b/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs index b3cce60858..8283b5df49 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs @@ -12,16 +12,13 @@ namespace Microsoft.AspNet.OData.Query public class ModelBoundQuerySettings { private int? _pageSize; - private int? _maxTop = 0; + private int? _maxTop; private Dictionary _expandConfigurations = new Dictionary(); private Dictionary _selectConfigurations = new Dictionary(); private Dictionary _orderByConfigurations = new Dictionary(); private Dictionary _filterConfigurations = new Dictionary(); - internal static ModelBoundQuerySettings DefaultModelBoundQuerySettings = new ModelBoundQuerySettings - { - _maxTop = 0 - }; + internal static ModelBoundQuerySettings DefaultModelBoundQuerySettings = new ModelBoundQuerySettings(); /// /// Instantiates a new instance of the class