Skip to content

Fixed issue with IncrementalLoadingCollection within AdvancedCollecti… #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,7 @@ int IComparer<object>.Compare(object x, object y)
if (!_sortProperties.Any())
{
var listType = _source?.GetType();
Type type;

if (listType != null && listType.IsGenericType)
{
type = listType.GetGenericArguments()[0];
}
else
{
type = x.GetType();
}
Type type = x.GetType();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR here. I'm not sure of a .NET convention for the ordering of generic types like this with multiples. But since IncrementalLoadingCollection is also in this same component, we can just check if the type is the collection and grab the proper type, then fallback to the existing logic. I think that'd be a less disruptive change for this specific scenario?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-hawker I added a clause to the if statement to check if the source is an IncrementalLoadingCollection. Let me know how it looks.


foreach (var sd in _sortDescriptions)
{
Expand Down