Skip to content

Conversation

@fiseni
Copy link
Collaborator

@fiseni fiseni commented Apr 16, 2025

@fiseni fiseni requested review from Copilot and removed request for Copilot April 16, 2025 13:21
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 PR adds tests to verify that the Entity Framework Core query translation works correctly with TPH inheritance and ThenInclude. The key changes are:

  • Introducing a new DbSet and configuration for the Bar entity and its derived types.
  • Adding a TPH mapping in the DbContext for BarDerived.
  • Implementing new tests in IncludeEvaluatorTests to compare query strings generated using inheritance-based navigation.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/Ardalis.Specification.EntityFrameworkCore.Tests/Fixture/TestDbContext.cs Added DbSet for Bar and TPH mapping configuration for BarDerived.
tests/Ardalis.Specification.EntityFrameworkCore.Tests/Fixture/Data/Bar.cs Added new classes (Bar, BarChild, BarDerived, BarDerivedInfo) for testing TPH inheritance.
tests/Ardalis.Specification.EntityFrameworkCore.Tests/Evaluators/IncludeEvaluatorTests.cs Added tests checking the query translation for ThenInclude with TPH inheritance.
Comments suppressed due to low confidence (1)

tests/Ardalis.Specification.EntityFrameworkCore.Tests/Fixture/Data/Bar.cs:8

  • Ensure that the project is targeting a C# version (such as C# 12) that supports collection expressions for List initializations to avoid potential compilation issues.
private readonly List<BarChild> _barChildren = [];

@fiseni fiseni requested a review from ardalis April 16, 2025 13:22
@ardalis ardalis merged commit 88a6898 into main Apr 17, 2025
1 check passed
@fiseni fiseni deleted the tests-include-inheritance-model branch April 17, 2025 16:37
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.

3 participants