-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
GeneratorThis issue focuses on the source generatorThis issue focuses on the source generatorenhancementNew feature or requestNew feature or request
Description
Describe the solution you'd like
When creating a mapper create 2 Map methods, one that takes the source and context (already exists) and another that takes just a source. This add a slight performance boost and for simple cases will mean the same performance as manual mapping.
This will only work if the mapper doesn't require the context (for example if preserve references is enabled, pre/post map methods and custom member methods require the context).
Example Source and generated code
[GenerateMapper]
[Map<Source, Dest>]
public partial class Mapper;
// Generates
public partial class Mapper
{
public Dest Map(Source source)
{
...
}
public Dest Map(Source source, MapperContext context)
{
...
}
}
// Instead of
public partial class Mapper
{
public Dest Map(Source source, MapperContext? context = null)
{
context ??= new();
...
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
GeneratorThis issue focuses on the source generatorThis issue focuses on the source generatorenhancementNew feature or requestNew feature or request