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
Copy file name to clipboardExpand all lines: CLAUDE.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Documentation is built using DocFX and deployed to GitHub Pages. The documentati
56
56
- Base controller for JSON:API endpoints
57
57
- Provides methods: `JsonApiOk()`, `JsonApiQueryAsync()`, `JsonApiCreated()`, `JsonApiNotFound()`, etc.
58
58
- Handles query parameter parsing and response formatting
59
-
- Automatically applies filtering, sorting, pagination, and includes (filtering applies to main entity; includes load related resources)
59
+
- Automatically applies filtering, sorting, pagination, and includes (filtering applies to main entity and included resources; includes load related resources)
60
60
61
61
2.**JsonApiMapper** (`Mapping/JsonApiMapper.cs`)
62
62
- Core mapper for converting entities to JSON:API resource structures
@@ -80,13 +80,18 @@ Documentation is built using DocFX and deployed to GitHub Pages. The documentati
80
80
6.**Validation** (`Validation/`)
81
81
-`IncludePatternValidator`: Validates include patterns with wildcard support
82
82
83
+
7.**Include Filtering** (`Extensions/Querying/`)
84
+
-`IncludeFilterParser`: Separates filters targeting included resources from main entity filters
85
+
-`FilteredIncludeBuilder`: Applies filtered includes using EF Core's filtered Include functionality
86
+
- Enables filtering on relationships (e.g., `filter[author.name]=John` with `include=author`)
87
+
83
88
### Key Patterns
84
89
85
90
-**Convention-based mapping**: Properties are automatically mapped from C# PascalCase to JSON camelCase
-**Async-first**: Main controller method `JsonApiQueryAsync()` is async and works with `IQueryable<T>`
88
93
-**Entity Framework integration**: Uses EF Core's `Include()` and query building capabilities
89
-
-**Filter expressions**: Complex filtering with operators (eq, ne, gt, lt, contains, etc.), logical grouping, and enum support
94
+
-**Filter expressions**: Complex filtering with operators (eq, ne, gt, lt, contains, etc.), logical grouping, enum support, and filtering on included resources
90
95
-**JSON column detection**: Collections and complex objects without ID properties are automatically mapped as JSON attributes instead of relationships (useful for EF Core owned entities stored as JSON columns)
91
96
-**Pagination safety**: Invalid page numbers are automatically clamped to valid ranges (page 1 for negative/zero, last page for overflow)
92
97
-**Include whitelisting**: Use `AllowedIncludesAttribute` on controller actions to restrict which relationships can be included, preventing unauthorized data exposure
0 commit comments