RequestHandlerSettings class
namespace: Serenity.Services assembly: Serenity.Net.Services
Contains settings that are applied to request handlers. Bound from the RequestHandlerSettings section in appsettings.json when available.
public class RequestHandlerSettings : IOptions<RequestHandlerSettings>
Public Members
| name | description |
|---|---|
| RequestHandlerSettings() | The default constructor. |
| static readonly Default | Gets the default settings (no limits). |
| DefaultPageSize { get; set; } | Gets or sets the default page size (take) applied when a List request does not specify one (e.g. take is zero). Zero means no default, so all records may be returned. |
| ExcludeTotalCountByDefault { get; set; } | Gets or sets whether the total record count is excluded by default for list requests that do not explicitly specify ExcludeTotalCount (i.e. it is null / not sent). Default is false, which preserves the historical behavior of calculating the total (and issuing a COUNT(*)) for paged requests. When a request has a zero take that DefaultPageSize / MaxPageSize turns into an actual page size, the total is still returned as if ExcludeTotalCount was false, unless IncludeMore was requested (a More indicator is returned instead). |
| MaxPageSize { get; set; } | Gets or sets the maximum page size (take) allowed for List requests. When greater than zero, a requested page size larger than this is clamped to this value, and an unspecified page size is also limited to this value. The response returns the applied take. Zero means no limit. |
| Value { get; } | Gets this instance. |
| With(…) | Creates a copy of these settings with the specified changes applied, without modifying this instance. Useful for returning different settings per request / entity, e.g. a limited page size for public access and unlimited for administrators. |
| const SectionKey | The default section key in appsettings.json |
See Also
- Source: RequestHandlerSettings.cs