Mapster 3.2.0

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

Install-Package Mapster -Version 3.2.0
dotnet add package Mapster --version 3.2.0
paket add Mapster --version 3.2.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<TDestination>();
Mapping to an existing object

You make the object, Mapster maps to the object.

TDestination destObject = new TDestination();
destObject = 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();
}

Performance

Don't let other libraries slow you down, raw Mapster performance is at least 2.5 times faster!

image

And you can boost another 1.3 - 4.0 times faster with FastExpressionCompiler!

What's new in 3.0

Debugging generated mapping function!
image

Mapping your DTOs directly to EF6!

var poco = dto.BuildAdapter()
              .CreateEntityFromContext(db)
              .AdaptToType<DomainPoco>();

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<TDestination>();
Mapping to an existing object

You make the object, Mapster maps to the object.

TDestination destObject = new TDestination();
destObject = 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();
}

Performance

Don't let other libraries slow you down, raw Mapster performance is at least 2.5 times faster!

image

And you can boost another 1.3 - 4.0 times faster with FastExpressionCompiler!

What's new in 3.0

Debugging generated mapping function!
image

Mapping your DTOs directly to EF6!

var poco = dto.BuildAdapter()
              .CreateEntityFromContext(db)
              .AdaptToType<DomainPoco>();

Change logs

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

Usages

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

Version History

Version Downloads Last updated
3.2.0 11,934 9/9/2018
3.1.8 99,646 11/16/2017
3.1.7 799 11/11/2017
3.1.6 6,578 10/15/2017
3.1.5 986 10/9/2017
3.1.4 2,359 10/1/2017
3.1.3 11,349 8/22/2017
3.1.1 13,425 6/19/2017
3.1.0 2,774 6/11/2017
3.0.4 2,081 5/28/2017
2.6.1 20,940 12/8/2016
2.6.0 481 12/3/2016
2.5.0 22,592 8/7/2016
2.4.3 1,699 7/14/2016
2.4.2 558 7/4/2016
2.4.1 573 6/22/2016
2.4.0 398 6/18/2016
2.3.0 4,539 3/18/2016
2.1.2 2,437 2/15/2016
2.1.1 562 1/29/2016
2.1.0 682 1/25/2016
2.0.4 404 1/21/2016
2.0.3 416 1/20/2016
2.0.2 340 1/19/2016
2.0.1 337 1/19/2016
2.0.0 351 1/19/2016
1.14.0 8,838 3/4/2015
1.12.0 454 3/2/2015