JustItMap 0.1.3

dotnet add package JustItMap --version 0.1.3
                    
NuGet\Install-Package JustItMap -Version 0.1.3
                    
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="JustItMap" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JustItMap" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="JustItMap" />
                    
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 JustItMap --version 0.1.3
                    
#r "nuget: JustItMap, 0.1.3"
                    
#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 JustItMap@0.1.3
                    
#: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=JustItMap&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=JustItMap&version=0.1.3
                    
Install as a Cake Tool

<div align="center"> <img src="assets/logos/logo.png" alt="JustItMap Logo" width="200" />

JustItMap

A lightweight, explicit, and predictable object-mapping library for .NET

build NuGet NuGet Downloads .NET License: MIT </div>

๐ŸŽฏ Philosophy

JustItMap follows a simple rule:

  • Convention when it is obvious - automatic mapping by property name
  • Explicit mapping when it is not - override with MapFrom when needed

This keeps the API small, readable, and easy to reason about while still covering the common cases you need in DTO, entity, model, and view-model transformations.

โœจ Features

  • โœ… Automatic mapping by property name - Convention over configuration
  • โœ… Compatible type conversion - Smart type conversion when needed
  • โœ… Nested object mapping - Handles complex object hierarchies
  • โœ… Collection mapping - Map lists, arrays, and enumerables
  • โœ… Explicit override - Use MapFrom for custom mappings
  • โœ… Explicit ignore - Skip properties with IgnoreMap
  • โœ… Lightweight - Minimal dependency footprint
  • โœ… Works standalone - No DI container required (but integrates well)
  • โœ… Multi-SDK support - .NET 8.0, 9.0, 10.0

๐Ÿ“ฆ Installation

NuGet Package

dotnet add package JustItMap

Or via NuGet Package Manager:

Install-Package JustItMap

Supported Frameworks

  • .NET 8.0 and later
  • .NET 9.0
  • .NET 10.0

๐Ÿš€ Quick Start

Basic mapping

var user = new User
{
    Id = 42,
    Name = "Ada Lovelace",
    Email = "ada@example.com"
};

var dto = user.MapTo<UserDto>();
// dto.Id = 42
// dto.Name = "Ada Lovelace"
// dto.Email = "ada@example.com"

Explicit mapping override

Use MapFrom to explicitly map properties when names don't match:

public class UserDtoProfile : MappingProfile<User, UserDtoWithFullName>
{
    public UserDtoProfile()
    {
        MapFrom(
            destination => destination.FullName,
            source => source.FirstName + " " + source.LastName
        );
    }
}

var source = new User
{
    FirstName = "Ada",
    LastName = "Lovelace"
};

var result = source.MapTo<UserDtoWithFullName>();
// result.FullName == "Ada Lovelace"

Ignoring a property

Use IgnoreMap attribute to skip properties during mapping:

public class UserDto
{
    public int Id { get; set; }
    public string Name { get; set; }
    
    [IgnoreMap]
    public string Password { get; set; }
}

var source = new User
{
    Id = 7,
    Name = "Grace",
    Password = "secret"
};

var dto = source.MapTo<UserDto>();
// Password is skipped (remains null or default)

Collection mapping

var users = new[]
{
    new User { Id = 1, Name = "Alan" },
    new User { Id = 2, Name = "Linus" }
};

var dtos = users.MapToCollection<UserDto>();
// Returns IEnumerable<UserDto>

๐ŸŽฏ Mapping Priority Order

The mapping engine follows this priority (highest to lowest):

  1. IgnoreMap - Properties marked to be ignored
  2. Explicit MapFrom - Custom mapping rules in MappingProfile
  3. Convention mapping - Automatic mapping by property name and compatible types

This ensures that explicit rules always win over implicit behavior.

๐Ÿ”ง Dependency Injection

Register JustItMap in your application's DI container:

services.AddJustItMap();

Then inject and use:

public class MyService
{
    private readonly IMapper _mapper;
    
    public MyService(IMapper mapper)
    {
        _mapper = mapper;
    }
    
    public UserDto MapUser(User user)
    {
        return _mapper.Map<UserDto>(user);
    }
}

๐Ÿ“– Documentation

For detailed documentation and advanced usage, see the full documentation.

๐Ÿงช Testing

This repository uses xUnit for testing.

To run tests locally:

dotnet test -c Release

โš–๏ธ License

MIT License - see LICENSE file for details.

๐Ÿ‘ฅ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“ž Support

For issues and questions, please use the GitHub Issues page.

dotnet run --project tests/JustItMap.Tests

License

MIT

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
0.1.3 83 9/1/2026
0.1.2 94 8/31/2026
0.1.1 93 8/30/2026
0.1.0 85 8/30/2026