Skip to content

Conversation

@bkoelman
Copy link
Member

With this PR, the collection element type for custom collection types that have no or multiple type parameters is now correctly detected.

JADNC v5.7.0 added internal assertions on the IQueryable<T> element type T to make it easier to track errors/bugs. It uses CollectionConverter.FindCollectionElementType to determine the element type, but that works only with types that have exactly one generic type parameter. MongoDB uses an internal type MongoQuery<TDocument, TOutput> : IQueryable<TOutput>, which causes assertion failures. This PR fixes that by properly walking up the interface hierarchy to infer that TOutput is the element type.

QUALITY CHECKLIST

@codecov
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.78%. Comparing base (3ad189d) to head (f7949df).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1720   +/-   ##
=======================================
  Coverage   90.78%   90.78%           
=======================================
  Files         467      467           
  Lines       14611    14612    +1     
  Branches     2299     2302    +3     
=======================================
+ Hits        13264    13265    +1     
  Misses        917      917           
  Partials      430      430           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bkoelman bkoelman marked this pull request as ready for review April 24, 2025 23:10
@bkoelman bkoelman merged commit a0877ab into master Apr 24, 2025
16 checks passed
@bkoelman bkoelman deleted the improve-collection-detection branch April 24, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants