Mappee is a high performance object-to-object mapper for .NET. It is a simple and easy to use library that can be used to map objects of different types. It is designed to be fast and efficient, and it is the fastest available mapper for .NET.
The main idea is to map objects using precompiled code, which makes it much faster than other mappers that use reflection.
Generated code is cached, so it is only generated once for each type pair, and then reused for all subsequent mappings.
varservicesCollection=new ServiceCollection();
servicesCollection.AddMappee(profile =>{ profile.Bind<TestObject,TestObjectDto>().IgnoreMember<TestObject,TestObjectDto>(e => e.Name).BeforeMap<TestObject,TestObjectDto>((source,_)=>{ source.Nickname =$"{source.FirstName}{source.LastName}".ToLower();}).AfterMap<TestObject,TestObjectDto>((_,destination)=>{ destination.Char = destination.FirstName.First();});//invoke compile method is not necessary, it will be called automatically});//[...]varserviceProvider= servicesCollection.BuildServiceProvider();varscope= serviceProvider.CreateScope();varmapper= scope.ServiceProvider.GetRequiredService<IMapper>();vartestObject=new TestObject();vartestObjectDto= mapper.Map<TestObject,TestObjectDto>(testObject);
Mappee vs other mappers (performance comparison)
Benchmarks
2500 items in 3 different collections and 2500 nested objects (like linked list)