Skip to content

Commit 80c6bd3

Browse files
PhenXCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8d37193 commit 80c6bd3

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/EntityFrameworkCore.Projectables/Extensions/QueryableExtensions.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,21 @@ public static IQueryable<TModel> ExpandProjectables<TModel>(this IQueryable<TMod
1010

1111
/// <summary>
1212
/// Ensures that all writable <c>[Projectable]</c> properties on <typeparamref name="TModel"/> are populated
13-
/// in query results by automatically generating a SELECT projection that merges all EF-mapped columns with
13+
/// in query results by automatically generating a SELECT projection that merges all EF-mapped properties and navigations with
1414
/// the expression-expanded value of every writable projectable property.
1515
/// <para>
1616
/// This method is particularly useful when fetching full entities (e.g. <c>FirstAsync()</c>,
17-
/// <c>ToListAsync()</c>) on a tracking context where the automatic select injection is otherwise
18-
/// suppressed to preserve change-tracking semantics. Call this method after any <c>Where</c>
17+
/// <c>ToListAsync()</c>) on queries that are tracked by default, where the automatic select injection is
18+
/// otherwise suppressed to preserve change-tracking semantics. Call this method after any <c>Where</c>
1919
/// or <c>OrderBy</c> clauses and before terminal operators.
2020
/// </para>
2121
/// <para>
22+
/// This method currently delegates to <see cref="ExpandProjectables{TModel}(IQueryable{TModel})"/> and does
23+
/// not override the root-rewrite guard for queries that already contain an explicit <c>AsTracking()</c> call
24+
/// in the expression tree. As a result, <c>query.AsTracking().AsExpandedProperties()</c> does not currently
25+
/// force projection injection.
26+
/// </para>
27+
/// <para>
2228
/// Read-only projectable properties (those without a setter) are not included in the generated projection
2329
/// because EF Core's materializer cannot set them on the resulting entity.
2430
/// </para>

0 commit comments

Comments
 (0)