Make ModelController's default return limit configurable - #573
Draft
nbeatty-gpa wants to merge 1 commit into
Draft
Make ModelController's default return limit configurable#573nbeatty-gpa wants to merge 1 commit into
nbeatty-gpa wants to merge 1 commit into
Conversation
nbeatty-gpa
force-pushed
the
recordsPerPageConfiguration
branch
from
August 4, 2026 20:03
1aa6fd0 to
ffbc8fa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Get
Takevalue fromDefaultRecordsPerPagesetting insystemSettingsfrom the configuration file.Still a draft because models which do not explicitly set the
Takevalue using theReturn Limitattribute sometimes behave differently whenTakeis notnull.For example, in System Center, the
ByUserandByUserGrouppages overrideModelControllerfunctionality for non-database fields, so they are searched with the model controller, then filtered or sorted according to these fields, before being paginated afterwards. When theTakevalue is set, the baseModelControllerSQL query includes "TOP {Take}", which breaks the later filtering, sorting, and pagination.There also seem to be issues with some models such as
Assetwhen the default is set to a single-digit value, since in trying to link anAssetto anAssetType, it fetches allAssetTypes, but if they have aReturnLimitit's not guaranteed that an existing record will be pulled and found as a match.Overall, it seems to me that using the
Takevalue as both a limit for non-paged queries and a page size is problematic, and we would need to make these two values distinct.