MapsterMapper / MapsterMapper/Mapster
Tweaking null propagation easily
- Dominant language
- C#
- Stars
- 5.2k
- Forks
- 410
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
Is there an easy way to change how [null propagation](https://github.com/MapsterMapper/Mapster/wiki/Custom-mapping#null-propagation) works?
1) If we wanted to throw an exception when null reference encountered? There are lots of various `Ignore` methods, similarly I wish there were `Required` methods or maybe an `ThrowIfNull` argument to be passed in
2) If null encountered, use a provided value (I know atm it uses default or null value)
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 linked custom-mapping null-propagation documentation and inspect pull request #804, which is already open for this issue. Clarify whether the requested behavior is throwing on null, substituting a provided value, or both, then define the API and tests needed to demonstrate the agreed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100