A fast, fun and stimulating object to object Mapper
Clone or download
Failed to load latest commit information.
deploy renamed everything to mapster Mar 2, 2015
src add FastExpressionCompiler into Benchmark Oct 9, 2018
.gitignore clean up Apr 2, 2017
LICENSE Update LICENSE Jan 18, 2016
README.md Update README.md Oct 8, 2018


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,


Don't let other libraries slow you down, raw Mapster performance is at least 2.5 times faster!
And you can boost another 1.3 - 4.0 times faster with FastExpressionCompiler!

screen shot 2018-10-08 at 21 27 55

What's new in 3.0

Debugging generated mapping function! image

Mapping your DTOs directly to EF6!

var poco = dto.BuildAdapter()

Change logs