-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Task
Implement the ?include= query parameter for eager loading in C#/Entity Framework Core.
Endpoints
GET /buildingswith?include=roomsor?include=rooms.lampsGET /buildings/{id}with?include=rooms.lampsGET /buildings/{id}/roomswith?include=lampsGET /rooms/{id}with?include=lamps,building
Functional Requirement
Must minimize database queries regardless of the number of entities returned.
Implementation Hints
- Use EF Core's
.Include()and.ThenInclude()methods - Parse the
includeparameter and chain include calls dynamically - Example:
context.Buildings.Include(b => b.Rooms).ThenInclude(r => r.Lamps)
Acceptance Criteria
-
?include=roomsreturns buildings with nested rooms -
?include=rooms.lampsreturns buildings with rooms and lamps - Query count does not increase with number of buildings (verify with EF logging)
Parent Issue
Relates to #289
Reactions are currently unavailable