api-design-patterns

Defines application service interface conventions and DTO patterns for ASP.NET Zero APIs.

Updated May 22, 2026
One-click install
npx skills add https://github.com/shakesoft/timekeeper --skill api-design-patterns-shakesoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design-patterns
Source: https://github.com/shakesoft/timekeeper/tree/main/.cursor/skills/api-design-patterns
Command: npx skills add https://github.com/shakesoft/timekeeper --skill api-design-patterns-shakesoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inconsistent application service interfaces in ASP.NET Zero projects cause broken NSwag client proxies, mismatched permissions, and non-standard DTO usage across features. ## Core Features & Use Cases - Interface Conventions: Standard method signatures for list, get-for-edit, create, update, delete, and combobox operations on IApplicationService interfaces. - HttpPost Rule for Get Methods: Ensures Get* methods with custom input DTOs are decorated with [HttpPost] so NSwag generates typed body DTOs in service-proxies.ts instead of query-string parameters. - DTO Selection Guidance: Maps return types (PagedResultDto, ListResultDto, EntityDto, NullableIdDto) and input base classes (PagedAndSortedResultRequestDto) to specific use cases. - Use Case: When adding a new Product feature, follow the naming and permission table to produce an IProductAppService interface whose methods generate correct Angular service proxies on the first build. ## Quick Start Ask the assistant to design an application service interface for a new feature following the ASP.NET Zero API design patterns.

Frequently Asked Questions about api-design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design an application service interface in ASP.NET Zero?▼

Define an interface extending IApplicationService with standard methods: Get{Feature}s returning PagedResultDto for lists, Get{Feature}ForEdit taking NullableIdDto, and Create, Update, Delete methods returning Task. Follow the naming and permission conventions for each operation.

Why is my input DTO missing from service-proxies.ts in NSwag?▼

ABP routes Get* methods as HTTP GET by default, so NSwag emits the input as individual query-string parameters instead of a typed class. Decorate the method with [HttpPost] to force NSwag to generate the input DTO as a request body type.

Which return type should I use for a paged list in ABP?▼

Use PagedResultDto<T> for paginated lists since it includes TotalCount and Items. Use ListResultDto<T> when returning a full unpaginated list, and EntityDto for single-entity references.

What input DTO base class supports paging, sorting, and filtering?▼

PagedAndSortedResultRequestDto is the standard base class for list inputs that need paging, sorting, and a Filter property. For simple filtered lists without paging, a custom DTO with a Filter property is sufficient.

When should I use NullableIdDto as a method input?▼

Use NullableIdDto for GetForEdit operations where a null Id means creating a new entity and a provided Id means editing an existing one. This lets a single endpoint serve both create and edit form initialization.