MapsterMapper / MapsterMapper/Mapster
Add an overload to the Adapt method to allow using a local, temporary configuration.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.2k
- Forks
- 410
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
Previously, I added two overload for method Adapt that locally and temporarily modified the global configuration.
```
public static TDestination Adapt(this object? source, Action configAction)
public static TDestination Adapt(this object? source, Action> configAction)
```
What do you think about adding the following the overload to modify an existing object?
`public static TDestination Adapt(this object? source, TDestination destination, Action> SetterAction)`
And add an overload to `ProjectToType ` method that locally and temporarily modified the global configuration.
The proposed overload:
`public static IQueryable ProjectToType(this IQueryable source, TypeAdapterConfig? config = null, Action> SetterAction)`
Of course, the following method already exists in the current version and uses a `config ` instead of the global setting.
`public static IQueryable ProjectToType(this IQueryable source, Type destinationType, TypeAdapterConfig? config = null)`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Adapt overloads and ProjectToType methods, especially how they handle TypeAdapterConfig and local configuration actions. Done means adding the proposed destination-object and queryable overloads with temporary configuration behavior while preserving the existing config-based API; the issue does not name files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100