mappers

Convert between domain models, persistence entities, and API DTOs with static extension mappers.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/roromanenko/NewsParser --skill mappers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mappers
Source: https://github.com/roromanenko/NewsParser/tree/main/.claude/skills/mappers
Command: npx skills add https://github.com/roromanenko/NewsParser --skill mappers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defines a consistent approach to mapping between domain models and persistence entities, and to API DTOs, ensuring predictable transformations and minimizing ad-hoc code.

Core Features & Use Cases

  • One-file-per-aggregate mappers (e.g., ArticleMapper.cs), with related sub-types in the same file.
  • Static extension methods only, no instances, no DI, no side effects.
  • Infrastructure layer mappings for Entity ↔ Domain and Api layer mappings for Domain → DTO, with explicit patterns for enum handling, navigation properties, and vector data.

Quick Start

Create a new AggregateMapper.cs in the appropriate layer and implement static extension methods following the conventions.

Frequently Asked Questions about mappers

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

FAQPage Schema
How do I map domain models to persistence entities without dependency injection?

You can map domain models to persistence entities using static extension methods. This approach requires no instances, no dependency injection, and no side effects, ensuring predictable transformations between layers.

What is the standard structure for mapping domain models to API DTOs?

The standard structure for mapping domain models to API DTOs uses one file per aggregate, such as AggregateMapper.cs. Static extension methods handle the Domain to DTO conversion within the API layer explicitly.

How do you handle enums and navigation properties when mapping between domain and entity?

Mapping enums and navigation properties between domain and entity requires strict, explicit patterns defined in the mapper. The static extension methods apply these predefined conventions to ensure consistent transformations across infrastructure and API layers.

Can I use static extension methods for vector data mapping in my infrastructure layer?

Yes, you can use static extension methods for vector data mapping in the infrastructure layer. The mapper provides explicit patterns for vector handling, ensuring safe transformations between domain models and persistence entities.

What's the best way to organize mapper files for multiple domain aggregates?

The best way to organize mapper files for multiple domain aggregates is dedicating one AggregateMapper.cs per aggregate. Related sub-types reside in the same file, keeping infrastructure and API layer mappings structured and predictable.