dotnet-migrate-automapper-to-mapperly

Migrate AutoMapper Profile mappings to Mapperly mappers with DI rewiring.

8|1|Updated Feb 5, 2018
One-click install
npx skills add https://github.com/umbrella-libraries/Umbrella --skill dotnet-migrate-automapper-to-mapperly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-migrate-automapper-to-mapperly
Source: https://github.com/umbrella-libraries/Umbrella/tree/main/.ai-shared/skills/dotnet-migrate-automapper-to-mapperly
Command: npx skills add https://github.com/umbrella-libraries/Umbrella --skill dotnet-migrate-automapper-to-mapperly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating large codebases that rely on AutoMapper profiles to Mapperly mappers can be brittle and time-consuming. This skill provides a structured approach to translate mappings, rewire DI, and remove AutoMapper artefacts while preserving behavior.

Core Features & Use Cases

  • Migrates CreateMap patterns and ForMember/AfterMap configurations to Mapperly equivalents.
  • Rewires DI and removes AutoMapper dependencies to adopt Umbrella's Mapperly catalog.
  • Applies to solution-wide migrations across multiple projects with consistent interfaces and catalog wiring.

Quick Start

Migrate all AutoMapper Profile classes to Mapperly source-generated mappers across the solution.

Frequently Asked Questions about dotnet-migrate-automapper-to-mapperly

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

FAQPage Schema
How do I migrate AutoMapper profiles to Mapperly source-generated mappers?

Migrating AutoMapper profiles to Mapperly involves analyzing CreateMap patterns, ForMember and AfterMap configurations, then translating them into Mapperly mapper interfaces and wrappers while preserving original behavior and catalog structure.

What is the best way to rewire dependency injection when replacing AutoMapper with Mapperly?

Rewiring DI for Mapperly requires updating Program.cs to register the new Mapperly catalog, removing AutoMapper service registrations, and ensuring the generated mapper interfaces are correctly resolved across solution projects.

Can I migrate solution-wide AutoMapper mappings across multiple C# projects at once?

Yes, solution-wide migration translates AutoMapper Profile classes across multiple projects, applying consistent Mapperly interfaces and catalog wiring to ensure uniform mapping behavior throughout the entire codebase.

Do I need to manually install Mapperly packages before migrating AutoMapper code?

Yes, migrating to Mapperly requires installing the necessary Mapperly NuGet packages first, as the migration process generates source-based mappers that depend on these packages to compile and function correctly.

How does migrating AutoMapper to Mapperly handle AfterMap and ForMember custom configurations?

Migrating AfterMap and ForMember configurations analyzes these custom AutoMapper rules to produce equivalent Mapperly mapping logic, ensuring that complex property transformations and side effects are preserved in the generated code.

What limitations exist when removing AutoMapper artefacts during a Mapperly migration?

Removing AutoMapper artefacts depends on fully resolving all CreateMap and custom mapping logic into source-generated equivalents; complex runtime reflection patterns may require manual adjustment to fit Mapperly's compile-time generation model.