Skip to content

Simple.AutoMapper is a tool that automatically "copies data from one shape to another" within an app. Instead of manually moving the same information between database objects and view models, simple mapping rules can be defined once and quickly reused everywhere with precompiled mapping and caching.

License

Notifications You must be signed in to change notification settings

odinsoft-lab/simple.mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple.AutoMapper

NuGet .NET License Downloads Coverage

High-performance object mapping for .NET with expression tree compilation. Simple API, powerful configuration options.

Latest - Patch overloads (new object, type-inferred, collection), Map in-place via ISimpleMapper. See Release Notes.

Installation

dotnet add package Simple.AutoMapper

Target Frameworks: netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0

Quick Start

using Simple.AutoMapper.Core;

// Map — copy all properties to new object
var dto = Mapper.Map<User, UserDto>(user);

// Patch — copy only non-null properties (HTTP PATCH scenario)
Mapper.Patch(partialDto, existingEntity);

Before & After

// ❌ Without Simple.AutoMapper — manual property-by-property copy
var dto = new UserDto();
dto.Id = user.Id;
dto.FirstName = user.FirstName;
dto.LastName = user.LastName;
dto.Email = user.Email;
// ... repeat for every property, every model, every service

// ✅ With Simple.AutoMapper — one line
var dto = Mapper.Map<User, UserDto>(user);

For the full before/after comparison of every feature, see the Usage Guide.

Performance

  • Expression tree compilation for fast subsequent mappings
  • Thread-safe caching of compiled mappers
  • First mapping incurs compilation cost; subsequent calls are optimized

Test Coverage

  • 242+ tests passing
  • 92.9% line coverage, 88.8% branch coverage

Documentation

Samples

Sample Location Demonstrates
Console samples/Console/ All 19 features with static Mapper
WebAPI samples/WebAPI/ REST API with DI, PUT/PATCH endpoints

License

MIT License - see LICENSE.md

Team

Core Development Team

  • SEONGAHN - Lead Developer & Project Architect
  • YUJIN - Senior Developer & Exchange Integration Specialist
  • SEJIN - Software Developer & API Implementation

Built with care by the ODINSOFT Team | GitHub

About

Simple.AutoMapper is a tool that automatically "copies data from one shape to another" within an app. Instead of manually moving the same information between database objects and view models, simple mapping rules can be defined once and quickly reused everywhere with precompiled mapping and caching.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •