Mapster 4.1.0

A fast, fun and stimulating object to object mapper.  Kind of like AutoMapper, just simpler and way, way faster.

Install-Package Mapster -Version 4.1.0
dotnet add package Mapster --version 4.1.0
<PackageReference Include="Mapster" Version="4.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mapster --version 4.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Mapster Icon

Mapster - The Mapper of Your Domain

Writing mapping method is machine job. Do not waste your time, let Mapster do it.

Get it

PM> Install-Package Mapster

Basic usage

Mapping to a new object

Mapster creates the destination object and maps values to it.

var destObject = sourceObject.Adapt<Destination>();
Mapping to an existing object

You make the object, Mapster maps to the object.

sourceObject.Adapt(destObject);
Queryable Extensions

Mapster also provides extensions to map queryables.

using (MyDbContext context = new MyDbContext())
{
    // Build a Select Expression from DTO
    var destinations = context.Sources.ProjectToType<Destination>().ToList();

    // Versus creating by hand:
    var destinations = context.Sources.Select(c => new Destination {
        Id = p.Id,
        Name = p.Name,
        Surname = p.Surname,
        ....
    })
    .ToList();
}

What's new in Mapster 4.0

  • Two ways mapping
  • Unflattening
  • Map & ignore by property path
  • MaxDepth
  • Map to constructor

Why Mapster?

Performance

Don't let other libraries slow you down, Mapster performance is at least 2.5 times faster!
And 3.x times faster with FastExpressionCompiler and Mapster CodeGen!

image

Step into debugging

Step-into debugging lets you debug your mapping and inspect values as same as its your code.
image

Code Generation NEW!!

Mapster CodeGen lets you do mapping with

  • Validate mapping at compile time
  • Getting raw performance
  • Seeing your mapping code & debugging
  • Finding usage of your models' properties

Change logs

https://github.com/MapsterMapper/Mapster/releases

Usages

https://github.com/MapsterMapper/Mapster/wiki

Mapster Icon

Mapster - The Mapper of Your Domain

Writing mapping method is machine job. Do not waste your time, let Mapster do it.

Get it

PM> Install-Package Mapster

Basic usage

Mapping to a new object

Mapster creates the destination object and maps values to it.

var destObject = sourceObject.Adapt<Destination>();
Mapping to an existing object

You make the object, Mapster maps to the object.

sourceObject.Adapt(destObject);
Queryable Extensions

Mapster also provides extensions to map queryables.

using (MyDbContext context = new MyDbContext())
{
    // Build a Select Expression from DTO
    var destinations = context.Sources.ProjectToType<Destination>().ToList();

    // Versus creating by hand:
    var destinations = context.Sources.Select(c => new Destination {
        Id = p.Id,
        Name = p.Name,
        Surname = p.Surname,
        ....
    })
    .ToList();
}

What's new in Mapster 4.0

  • Two ways mapping
  • Unflattening
  • Map & ignore by property path
  • MaxDepth
  • Map to constructor

Why Mapster?

Performance

Don't let other libraries slow you down, Mapster performance is at least 2.5 times faster!
And 3.x times faster with FastExpressionCompiler and Mapster CodeGen!

image

Step into debugging

Step-into debugging lets you debug your mapping and inspect values as same as its your code.
image

Code Generation NEW!!

Mapster CodeGen lets you do mapping with

  • Validate mapping at compile time
  • Getting raw performance
  • Seeing your mapping code & debugging
  • Finding usage of your models' properties

Change logs

https://github.com/MapsterMapper/Mapster/releases

Usages

https://github.com/MapsterMapper/Mapster/wiki

Version History

Version Downloads Last updated
4.1.0 154 6/15/2019
4.0.0 16,700 4/13/2019
3.3.2 17,648 3/6/2019
3.3.1 15,693 2/5/2019
3.3.0 2,846 1/29/2019
3.2.0 78,985 9/9/2018
3.1.8 135,626 11/16/2017
3.1.7 1,014 11/11/2017
3.1.6 13,742 10/15/2017
3.1.5 1,256 10/9/2017
3.1.4 2,587 10/1/2017
3.1.3 20,849 8/22/2017
3.1.1 14,617 6/19/2017
3.1.0 3,192 6/11/2017
3.0.4 2,837 5/28/2017
2.6.1 26,191 12/8/2016
2.6.0 615 12/3/2016
2.5.0 26,344 8/7/2016
2.4.3 1,879 7/14/2016
2.4.2 674 7/4/2016
2.4.1 690 6/22/2016
2.4.0 526 6/18/2016
2.3.0 4,856 3/18/2016
2.1.2 3,017 2/15/2016
2.1.1 705 1/29/2016
2.1.0 795 1/25/2016
2.0.4 515 1/21/2016
2.0.3 530 1/20/2016
2.0.2 455 1/19/2016
2.0.1 464 1/19/2016
2.0.0 455 1/19/2016
1.14.0 10,187 3/4/2015
1.12.0 594 3/2/2015