Skip to content
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

feature: ReflectionSource and DictionarySource #426

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

axunonb
Copy link
Member

@axunonb axunonb commented Jun 29, 2024

Closes #425

Changes to ReflectionSource

  • Modified ReflectionSource.TypeCache to be static, shared across all instances.
  • Implemented a control mechanism for the size of ReflectionSource.TypeCache. When the cache exceeds the maximum size limit, it now removes the oldest entry first, adhering to a First-In-First-Out (FIFO) strategy.
  • Enhanced documentation for CaseSensitivityType.CaseInsensitive: Clarified that in scenarios where multiple members share the same name but differ in case, the first encountered member will be selected.

Updates to DictionarySource

  • Correction: Ensured that generic dictionaries and dynamic objects respect the case sensitivity settings.
  • Added to the documentation: Specified that the cache for IReadOnlyDictionary is deliberately scoped to the instance level.

* Make ReflectionSource.TypeCache static
* Control size of ReflectionSource.TypeCache, remove oldest item first
* dynamics in DictionarySource also use case-sensitivity setting
* Cache for IReadOnlyDictionary has instance scope
Only before NETCore3.1, the dictionary is not ordered by insertion order.
* Add comment about handling case-sensitivity
* Add test for: When there are multiple members with the same name but different case, the first member is used
* for DictionarySource
* for ReflectionSource
@axunonb axunonb requested a review from karljj1 June 29, 2024 14:24
@axunonb axunonb changed the title feature: RelectionSource and DictionarySource feature: ReflectionSource and DictionarySource Jun 29, 2024
Copy link

codecov bot commented Jun 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97%. Comparing base (421c715) to head (1099e09).

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #426   +/-   ##
===================================
  Coverage    97%    97%           
===================================
  Files        96     96           
  Lines      3400   3422   +22     
===================================
+ Hits       3282   3304   +22     
  Misses      118    118           

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

@axunonb
Copy link
Member Author

axunonb commented Jul 2, 2024

Thanks for the review. Wiki is updated accordingly.

@axunonb axunonb merged commit 2bf827f into axuno:main Jul 2, 2024
5 checks passed
@axunonb axunonb deleted the pr/reflection-dict-source branch July 2, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static cache for ReflectionSource and DictionarySource?
2 participants