MapsterMapper / MapsterMapper/Mapster
Adapt(source, destination) does not work when destination is a C# record
- Dominant language
- C#
- Stars
- 5.2k
- Forks
- 410
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
When using Mapster to map data into an existing object, the mapping works correctly if the destination is a class, but does nothing when the destination is a C# record.
This appears to be caused by record immutability, but the current behavior is not clearly documented and can be misleading.
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 with the Adapt(source, destination) entry point and reproduce the difference between mapping into a class and into a C# record. Review open pull request #835 for the work already under way. Done should mean the record behavior is corrected or the limitation is clearly documented, with the misleading behavior addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100