EntityFrameworkCore.Projectables icon indicating copy to clipboard operation
EntityFrameworkCore.Projectables copied to clipboard

Add OnlyOnInclude option for the root rewritter

Open zoriya opened this issue 2 years ago • 1 comments

This allows projectable properties to be marked as OnlyOnInclude and only opt-in root query rewriting by explicitly calling a .Include(x => x.ProjectedProperty). This was discussed in #84 by @yinzara.

PS: maybe this should be the default mode for root query rewriting?

(PR based on #90)

zoriya avatar Oct 28 '23 22:10 zoriya

I like this, though I'm somewhat in doubt if this is really desired. By default in EF you'll get all properties when you select an Entity. If you want to select a subset then you'll have to be explicit about this. This turns that logic around, (you won't get it unless you explicitly ask for it). Granted this is already the case when it comes to including relationships...

koenbeuk avatar Oct 31 '23 01:10 koenbeuk