You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Projectables with Setters are hydrated when pulling full entities #224
In Projectables 6.x, a settable [Projectable] property is populated when an untracked query materializes the whole entity. In Projectables 3.x, the property remained null unless the query used it in an expression.
For example:
var posts = await db.Posts
.AsNoTracking()
.ToListAsync();
The query computes DisplayTitle and assigns it during materialization, even when the caller only needs the entity’s other properties.
This can add significant SQL and materialization work to whole-entity queries, especially when projectables contain correlated subqueries or other expensive expressions. Consumers may never read the resulting values.
Making the property read-only is not a suitable workaround for every application. HotChocolate's [UseProjection] needs setters to populate projectable properties. #129 Describes the HotChocolate requirements.
Expected behavior
Keep settable projectables available for query expressions and HotChocolate projections, while allowing consumers to opt out of populating them when a query materializes a whole entity.
A configuration option such as UseProjectables(o => o.PopulateSettableProperties(false)) could provide that control.
#84#86 Introduced the automatic hydration behavior
Activity
zmerdev commentedon Sep 25, 2026
see #223 for repro.