# Marten List Query

> Adds a new Query operation to fetch a paged list of resources with filtering. Handles caching and pagination.

- Skill: `majiayu000/marten-list-query` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/marten-list-query`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/marten-list-query/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/marten-list-query

---


Follow this guide to implement a **List Query** endpoint in the ApiService.

1.  **Prerequisites**
    -   Ensure the Projection exists.
    -   Ensure indexes are configured for filtered fields.

2.  **Create Endpoint**
    -   Create/Update `src/BookStore.ApiService/Endpoints/{Resource}Endpoints.cs`
    -   **Method**: `MapGet`
    -   **Logic**: `GetOrCreateLocalizedAsync` -> `Query` -> `Where` -> `ToPagedListAsync`
    -   **Template**: `templates/ListEndpoint.cs`

3.  **Client Integration**
    -   Create `IGet{Resource}sEndpoint.cs` in Client project.

## Related Skills
- `/marten__get_by_id`: For fetching a single resource.

