MapsterMapper / MapsterMapper/Mapster
Why is the list collection mapping configuration invalid
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.2k
- Forks
- 410
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
TypeAdapterConfig.GlobalSettings.Default.IgnoreNullValues(true);
var config = new TypeAdapterConfig();
config.ForType().IgnoreNullValues(true);
List lista=new List();
List listb=new List();
var test1= input[0].Adapt(entity[0], config);
var test2= input.Adapt(entity, config);
The first is correct. Null is not mapped
The list set mapping directly maps null into it
Does not support mapping collection types????
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 reproducing the two calls in the issue, comparing single-object mapping with mapping from List to List under IgnoreNullValues(true). Trace the collection mapping path and configuration handling; done means null values are treated consistently for both the direct and collection mappings, with a regression test covering the reported example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100