Skip to content

Conversation

@YuriyDurov
Copy link
Member

This pull request introduces dynamic query projection capabilities and refactors repository methods to support flexible filtering. The changes include updates to the BooksController in the sample app to showcase handling query parameters for dynamic projections, modifications to repository interfaces and implementations to support generic filtering, and cleanup of unused methods.

Dynamic Query Projection

Sample App

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces dynamic query projection capabilities to enable flexible query filtering and projection. Key changes include:

  • Adding overloads to repository interfaces and implementations to support filtering via a Func<IQueryable, IQueryable> predicate.
  • Updating the sample BooksController to accept a "property" query parameter for dynamic projection.
  • Adjustments to the sample HTTP request file and cleanup in the test controller.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/BitzArt.CA.TestApp/Controllers/TestController.cs Commented out logging and response code in TestGet; ensure this is intentional.
src/BitzArt.CA.Persistence.EntityFrameworkCore/Repositories/AppDbRepository.cs Added dynamic filtering overloads and new Set methods to enable dynamic query projection.
src/BitzArt.CA.Core/Interfaces/IRepository.cs Introduced new method signatures for dynamic projection capabilities.
sample/SampleApp/Services/BitzArt.CA.SampleApp.WebApi/Controllers/BooksController.cs Updated GetAllAsync to demonstrate dynamic projection based on the "property" query parameter.
sample/SampleApp/Requests/Books.http Added examples to test the new query parameter functionality.
Comments suppressed due to low confidence (1)

sample/SampleApp/Services/BitzArt.CA.SampleApp.WebApi/Controllers/BooksController.cs:20

  • For consistency in dynamic projection responses, consider always applying an explicit projection (even if it's an identity mapping) so that the return type remains predictable.
            return q;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants