Example 1: Select — Field Projection
The Select<T> extension takes a list of field paths. Each variant below shows a different projection style.
Direct scalars
{ "fields": ["Id", "Name", "Price"] }Dotted path through reference navigation
{ "fields": ["Id", "Name", "Category.Name"] }Category is projected with only the requested Name sub-field (Id auto-included).
Dotted path through collection navigation
{ "fields": ["Id", "Name", "Category.Vendors.Id"] }Category.Vendors is a collection — each Vendor element is projected with only its Id (Id auto-included).
Whole navigation object (non-dotted)
{ "fields": ["Id", "Name", "Category"] }The entire Category object is bound as-is.
Whole collection (non-dotted)
{ "fields": ["Id", "Name", "Brands"] }The entire Brands collection is bound as-is.
Note
Backend:
query.Select(fields)Related
- Select extension
- SelectDynamic example — same paths, dynamic return type.