Show HN: Mapperly – A .NET source generator for object to object mappings
1–10 of 71 posts
Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#2Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#3Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#4I've never really understood the use case for these mapping generators. Every time I've seen them used (MapStruct in Java, AutoMapper in C#) the mapping configuration eventually ends up being so complex that just manually writing out the mapping would've been just as simple and arguably simpler to understand.
Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#5What are the advantages over AutoMapper?
Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#6What are the advantages over AutoMapper?
Automapper generates all mappings at runtime with reflection. Mapperly in contrast uses roslyn based source generators and generates all mapping code at compile time. This leads to improved runtime performance with less allocations [1]. Since no reflection is used at runtime, the generated code is completely trimming save and AOT friendly. [1] https://github.com/mjebrahimi/Benchmark.netCoreMappers
Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#7I've never really understood the use case for these mapping generators. Every time I've seen them used (MapStruct in Java, AutoMapper in C#) the mapping configuration eventually ends up being so complex that just manually writing out the mapping would've been just as simple and arguably simpler to understand.
All that said, given these mappers exist, the fact this Mapperly does ahead of time code generation is an advantage over the previous generation of generators which had to use reflection.
Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#8Re: Show HN: Mapperly – A .NET source generator for object to object mappings
#9I've never really understood the use case for these mapping generators. Every time I've seen them used (MapStruct in Java, AutoMapper in C#) the mapping configuration eventually ends up being so complex that just manually writing out the mapping would've been just as simple and arguably simpler to understand.