aspnetzero-dto-patterns

Generates ASP.NET Zero DTO classes with Data Annotations validation conventions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers building ASP.NET Zero applications often create inconsistent DTOs, mix validation frameworks, or reuse a single DTO across operations, leading to maintenance issues and broken conventions. ## Core Features & Use Cases - Standardized DTO Structure: Provides templates for List, Edit, Create, GetForEdit output, and paged input DTOs placed in Application.Shared under a feature Dto folder. - Validation Conventions: Enforces System.ComponentModel.DataAnnotations attributes like [Required], [StringLength], and [Range] instead of FluentValidation. - Use Case: When adding a new Product feature to an ASP.NET Zero app, generate ProductListDto, ProductEditDto, CreateProductDto, GetProductForEditOutput, and GetProductsInput following the framework's exact patterns, including NullableIdDto-based GetForEdit handling. ## Quick Start Ask the AI to create the full set of DTOs for a new feature in your ASP.NET Zero Application.Shared project following the standard patterns.

Frequently Asked Questions about aspnetzero-dto-patterns

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

FAQPage Schema
How do I create DTOs in ASP.NET Zero?▼

Place DTOs in the Application.Shared project under a feature-specific Dto folder. Create separate classes per operation: a ListDto inheriting EntityDto, an EditDto with validation attributes, a CreateDto, a GetForEdit output wrapper, and a paged input inheriting PagedAndSortedResultRequestDto.

Should I use FluentValidation or Data Annotations in ASP.NET Zero?▼

ASP.NET Zero conventions use System.ComponentModel.DataAnnotations, not FluentValidation. Apply attributes like [Required], [StringLength(max)], [Range(min, max)], and [EmailAddress] directly on DTO properties, and avoid using double.MaxValue as a maximum.

How does GetForEdit work in ASP.NET Zero app services?▼

GetForEdit takes NullableIdDto as input rather than a custom DTO. A null Id means create mode, returning a new DTO with defaults plus lookup data; a non-null Id loads the entity. UIs always call GetForEdit, even for create, to receive dropdown options.

Can I reuse one DTO for both create and list operations?▼

No, the convention requires separate DTOs per operation. List DTOs inherit EntityDto with a non-nullable Id from the database, while Create DTOs carry only input fields with validation attributes. Mixing them breaks serialization and validation expectations.

What base class should paged list inputs use in ASP.NET Zero?▼

Paged list inputs should inherit PagedAndSortedResultRequestDto, which provides paging and sorting parameters. Add a Filter string property as the standard name for text search across list queries.