Brainy.Mapper 1.0.5

dotnet add package Brainy.Mapper --version 1.0.5
                    
NuGet\Install-Package Brainy.Mapper -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Brainy.Mapper" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Brainy.Mapper" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Brainy.Mapper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Brainy.Mapper --version 1.0.5
                    
#r "nuget: Brainy.Mapper, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Brainy.Mapper@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Brainy.Mapper&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Brainy.Mapper&version=1.0.5
                    
Install as a Cake Tool

Brainy.Mapper

Brainy.Mapper is a lightweight and high-performance object mapping library for .NET 8, 9 & 10.

It was built to provide a clean, fast, and dependency-light alternative for mapping objects without unnecessary complexity. Whether you're mapping DTOs, entities, nested models, or query projections, Brainy.Mapper keeps the API simple while covering the features commonly required in real-world applications.

The library follows familiar mapping conventions, making it easy to adopt while remaining lightweight and fully open source.


Features

  • 🚀 Fast object-to-object mapping
  • ðŸŽŊ Convention-based property mapping
  • 🔄 Custom member mapping with ForMember()
  • ðŸ“Ķ Nested object mapping
  • 📋 Collection and array mapping
  • ðŸŒģ Automatic property flattening
  • ðŸšŦ Ignore destination members
  • ✏ïļ Map onto existing objects
  • ðŸ”Ē Automatic enum conversion
  • 📈 LINQ ProjectTo() support
  • 💉 Dependency Injection support
  • ðŸ§Đ Automatic mapping registration using IMap<T>
  • ðŸ›Ąïļ Null-safe projections
  • ⚙ïļ Configurable mapping profiles
  • ðŸŠķ Lightweight with minimal dependencies
  • 🆓 Free and open source

Why Brainy.Mapper?

Brainy.Mapper was created with one goal in mind:

Provide the mapping features developers actually use without adding unnecessary complexity.

Many mapping libraries have grown significantly over time, introducing features that aren't needed in every project or moving toward commercial licensing. Brainy.Mapper focuses on delivering the core mapping experience in a clean, maintainable, and developer-friendly way.

Whether you're building a small API, a Clean Architecture application, or a large enterprise solution, Brainy.Mapper helps reduce repetitive mapping code while keeping configuration straightforward and easy to understand.


Installation

Install the package from NuGet.

dotnet add package Brainy.Mapper

or

Install-Package Brainy.Mapper

Quick Start

Create a Profile

public class UserProfile : Profile
{
    public UserProfile()
    {
        CreateMap<User, UserDto>()
            .ForMember(
                d => d.FullName,
                opt => opt.MapFrom(s => s.FirstName + " " + s.LastName));
    }
}

Configure the Mapper

var configuration = new MapperConfiguration(cfg =>
{
    cfg.AddProfile<UserProfile>();
});

var mapper = configuration.CreateMapper();

Map Objects

UserDto dto = mapper.Map<UserDto>(user);

Dependency Injection

Brainy.Mapper includes built-in Dependency Injection support.

builder.Services.AddBrainyMapper(
    Assembly.GetExecutingAssembly());

Then simply inject IMapper.

public class UserService
{
    private readonly IMapper _mapper;

    public UserService(IMapper mapper)
    {
        _mapper = mapper;
    }
}

Automatic Mapping Registration

Brainy.Mapper can automatically discover mappings from your assembly using the IMap<T> interface.

public class UserMapping : IMap<User>
{
    public void Mapping(Profile profile)
    {
        profile.CreateMap<User, UserDto>();
    }
}

No manual registration of every mapping class is required.


Collection Mapping

List<UserDto> users =
    mapper.Map<List<UserDto>>(entities);

Nested Object Mapping

public class Department
{
    public string Name { get; set; }
}

public class Student
{
    public Department Department { get; set; }
}
public class StudentDto
{
    public DepartmentDto Department { get; set; }
}

Nested objects are mapped automatically when a mapping exists for both types.


Property Flattening

Brainy.Mapper automatically supports property flattening.

public class Student
{
    public Department Department { get; set; }
}
public class StudentDto
{
    public string DepartmentName { get; set; }
}

No additional configuration is required.


Custom Member Mapping

CreateMap<User, UserDto>()
    .ForMember(
        d => d.FullName,
        opt => opt.MapFrom(
            s => s.FirstName + " " + s.LastName));

Ignore Members

CreateMap<User, UserDto>()
    .ForMember(
        d => d.Password,
        opt => opt.Ignore());

Mapping to Existing Objects

mapper.Map(updateRequest, existingEntity);

Useful for update operations where an existing entity should be modified instead of creating a new instance.


ProjectTo

Project directly from an IQueryable without materializing entities first.

var users = context.Users
    .ProjectTo<UserDto>(mapper)
    .ToList();

This allows only the required columns to be selected by the underlying query provider.


Roadmap

  • ✅ Object Mapping
  • ✅ Nested Object Mapping
  • ✅ Collection Mapping
  • ✅ Property Flattening
  • ✅ Custom Member Mapping
  • ✅ Ignore Members
  • ✅ Existing Object Mapping
  • ✅ Enum Conversion
  • ✅ Dependency Injection
  • ✅ Assembly Scanning
  • ✅ ProjectTo Support
  • âģ Reverse Mapping
  • âģ Constructor Mapping
  • âģ Attribute-Based Mapping

Contributing

Contributions, bug reports, feature suggestions, and pull requests are always welcome.

If you find an issue or have an idea for improvement, feel free to open an issue on GitHub.


Author

Brainy.Mapper is created and maintained by Shakeel Iqbal, a Senior .NET Architect and C# Developer with extensive experience building enterprise applications and software solutions using the Microsoft technology stack.

If you find Brainy.Mapper useful, feel free to ⭐ star the repository, report issues, suggest improvements, or contribute through a pull request.


License

Brainy.Mapper is released under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 108 8/21/2026
1.0.4 140 8/19/2026
1.0.3 130 8/19/2026
1.0.2 118 8/5/2026
1.0.1 105 8/3/2026
1.0.0 119 8/3/2026