Skip to content

v1.11.1

Choose a tag to compare

@pdevito3 pdevito3 released this 24 Nov 13:35
· 21 commits to main since this release

Fixes

Sorting

Sorting by nested navigation properties now handles null intermediate objects gracefully, preventing NullReferenceException when using in-memory collections.

Before (v1.11.0)

  // Would throw NullReferenceException if Player is null
  var sorted = stats
      .ApplyQueryKitSort("MatchPlayer.Player.LastName asc")
      .ToList(); // πŸ’₯ NullReferenceException

After (v1.12.0)

  // Now works - null navigation properties are handled safely
  var sorted = stats
      .ApplyQueryKitSort("MatchPlayer.Player.LastName asc")
      .ToList(); // βœ… Works! Nulls sort first in ASC, last in DESC

Details

  • Null intermediate navigation properties now sort as null values rather than throwing
  • Database queries (IQueryable) continue to work as before via EF Core's LEFT JOIN handling
  • In-memory collections (IEnumerable) now behave consistently with database queries
  • For custom null coalescing logic, DerivedProperty remains available:
  var config = new QueryKitConfiguration(c =>
  {
      c.DerivedProperty<PlayerStat>(x =>
          x.MatchPlayer.LastName ??
          (x.MatchPlayer.Player != null ? x.MatchPlayer.Player.LastName : "Unknown"))
          .HasQueryName("playerName");
  });