Mapstor 1.0.6

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

Mapstor

High‑performance object mapping for .NET powered by Source Generators.

🚀 Overview

Mapstor is a compile‑time object mapping library for .NET.
It generates strongly‑typed mapping code using Source Generators, eliminating reflection and delivering near‑zero overhead at runtime.

Designed for APIs, microservices, and high‑throughput applications where performance and type safety matter.

✨ Features

  • ⚡ Ultra‑fast: mapping code is generated at compile time
  • 🧩 Type‑safe: errors are caught during compilation
  • 🛠️ Supports multiple target types via attributes
  • 📦 Zero dependencies
  • 🔍 AOT / NativeAOT friendly
  • 🔄 Incremental generator: only regenerates what changed
  • 🧬 Works with classes, records, and structs

📦 Installation

dotnet add package Mapstor

Usage Example

1. Entity with mapping attributes

using Example.DTOs;
using Mapstor.Attributes;

namespace Example.Entities;

[MapTo<UserDTO>]
[MapTo<AdminDTO>]
public class User
{
    public int Id { get; set; }

    // Maps to AdminDTO.NombreCompleto
    [MapMember<AdminDTO>(nameof(AdminDTO.NombreCompleto))]
    public string Nombre { get; set; } = string.Empty;

    public string Apellidos { get; set; } = string.Empty;
    public string Correo { get; set; } = string.Empty;

    // Ignored only when mapping to AdminDTO
    [MapIgnore<AdminDTO>]
    public DateOnly FechaNacimiento { get; set; }
}

2. Define your DTOs

namespace Example.DTOs;

public class UserDTO
{
    public int Id { get; set; }
    public string Nombre { get; set; } = string.Empty;
    public string Apellidos { get; set; } = string.Empty;
    public string Correo { get; set; } = string.Empty;
    public DateOnly FechaNacimiento { get; set; }
}

public class AdminDTO
{
    public int Id { get; set; }
    public string NombreCompleto { get; set; } = string.Empty;
    public DateOnly FechaNacimiento { get; set; }
}

3. Use the generated mapping methods

var usuario = new User
{
    Id = 1,
    Nombre = "John",
    Apellidos = "Doe",
    Correo = "prueba@gmail.com",
    FechaNacimiento = new DateOnly(1995, 9, 6)
};

var usuarioDTO = usuario.MapTo<UserDTO>();
var adminDTO = usuario.MapTo<AdminDTO>();
There are no supported framework assets in this 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.6 94 4/21/2026
1.0.5 129 4/21/2026
1.0.4 134 4/21/2026
1.0.3 136 4/21/2026
1.0.2 132 4/21/2026
1.0.1 135 4/21/2026
1.0.0 89 4/21/2026