Add named query filter support for .NET 10+ and verify interface compatibility#305
Merged
marcominerva merged 8 commits intodevelopfrom Mar 12, 2026
Merged
Conversation
…atibility - Add ApplyQueryFilter overloads with filterName parameter (NET10_0_OR_GREATER) - Add XML documentation to all ModelBuilderExtensions methods - Create TinyHelpers.EntityFrameworkCore.Tests project with 12 unit tests - Verify ApplyQueryFilter works with both base classes and interfaces - Update README with interface usage and named query filter documentation Co-authored-by: marcominerva <3522534+marcominerva@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for named query filters in TinyHelpers.EntityFrameworkCore
Add named query filter support for .NET 10+ and verify interface compatibility
Mar 11, 2026
There was a problem hiding this comment.
Pull request overview
Adds EF Core query-filter enhancements and verification around the TinyHelpers.EntityFrameworkCore helpers, including .NET 10 named query filter support and a dedicated test project.
Changes:
- Added .NET 10+ “named query filter” overloads to
ModelBuilderExtensions(behindNET10_0_OR_GREATER) and expanded XML docs. - Introduced a new
TinyHelpers.EntityFrameworkCore.Testsproject with unit tests covering interface/base-class filters, named filters, and entity-type discovery. - Updated
TinyHelpers.EntityFrameworkCoreREADME with interface and named-filter usage examples.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| TinyHelpers.slnx | Adds the new EF Core test project to the solution. |
| tests/TinyHelpers.EntityFrameworkCore.Tests/Usings.cs | Adds global xUnit using for the new test project. |
| tests/TinyHelpers.EntityFrameworkCore.Tests/TinyHelpers.EntityFrameworkCore.Tests.csproj | Defines the new net10.0 EF Core test project and references the EF Core helpers project. |
| tests/TinyHelpers.EntityFrameworkCore.Tests/Extensions/ModelBuilderExtensionsTests.cs | Adds unit tests for applying query filters (including named filters) and entity-type discovery. |
| src/TinyHelpers.EntityFrameworkCore/README.md | Documents interface-based filters and named query filters (.NET 10+). |
| src/TinyHelpers.EntityFrameworkCore/Extensions/ModelBuilderExtensions.cs | Adds named query filter overloads and improves XML documentation. |
You can also share your feedback on Copilot code review. Take the survey.
src/TinyHelpers.EntityFrameworkCore/Extensions/ModelBuilderExtensions.cs
Show resolved
Hide resolved
Refactored entity type filtering to use GetEntityTypes<TEntity> and IsAssignableTo for improved robustness. Updated query filter property access to use EF.Property<T> for better EF Core query translation support. These changes enhance maintainability and align with EF Core best practices.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
marcominerva
approved these changes
Mar 12, 2026
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.
EF Core 10 introduced named query filters (
HasQueryFilter(string, Expression)), enabling multiple filters per entity with selective disabling. This PR extendsApplyQueryFilterto support named filters and adds test coverage confirming interface-based filtering works correctly.Changes
ModelBuilderExtensions(behind#if NET10_0_OR_GREATER):ApplyQueryFilter<TEntity>(ModelBuilder, string filterName, Expression<Func<TEntity, bool>>)ApplyQueryFilter<TType>(ModelBuilder, string filterName, string propertyName, TType value)TinyHelpers.EntityFrameworkCore.Tests— 12 tests covering base class filters, interface filters, named filters, multiple filters per entity, and filter lookup by nameUsage
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.