Skip to content

TacoMapper

A very lightweight C# object mapper with a fluent API that supports basic mapping, conditional mapping, and combine mapping.

TacoMapper is designed to be readable, small, and efficient with the following features:

🌮 Basic Property Mapping

Auto-map properties with matching names and types for quick transformations.

🌯 Custom Transformations

Transform values during mapping with custom functions and expressions.

🥙 Conditional Mapping

Map properties based on conditions to handle complex business logic.

🌮 Combine Mapping

Combine multiple source properties into one destination property.

🔥 Fluent API

Chain mapping configurations for improved readability and maintainability.

📦 Collection Support

Map collections of objects efficiently with the same configuration.

🚫 Ignore Properties

Skip specific properties during mapping when needed.

⚡ Lightweight

Minimal dependencies and small footprint for better performance.

// Simple auto-mapping
var personDto = ObjectMapper.Map<Person, PersonDto>(person);
// Fluent API with custom mapping
var mapper = ObjectMapper.Create<Person, PersonDto>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.Age, src => src.DateOfBirth, dob => DateTime.Now.Year - dob.Year)
.Combine(dest => dest.FullName, src => $"{src.FirstName} {src.LastName}");
var result = mapper.MapFrom(person);
  • 🚀 Performance - Compiled expressions for fast execution after initial setup
  • 📖 Readable - Fluent API makes mapping configurations clear and maintainable
  • 🔧 Flexible - Supports simple auto-mapping and complex custom scenarios
  • 📏 Lightweight - Minimal dependencies with small memory footprint
  • 🎯 Focused - Does one thing well - object mapping with clean API

Ready to start mapping objects with TacoMapper? Check out our Getting Started Guide for installation instructions and your first mapping examples.

For more advanced scenarios, explore our comprehensive examples and API reference.