Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add AllowNullPropertyAssignment option to disable assigning null values to nullable properties #584

Merged
merged 1 commit into from Jul 26, 2023

Conversation

latonz
Copy link
Contributor

@latonz latonz commented Jul 19, 2023

add AllowNullPropertyAssignment option to disable assigning null values to nullable properties

Description

Adds AllowNullPropertyAssignment option to disable assigning null values to nullable properties.
Improves the documentation on the null handling.

Fixes #98

This does not fully implement #98, but it keeps the API surface as well as the implementation simpler, while still addressing all arisen user-requested features (#96 and #452).

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@latonz latonz self-assigned this Jul 19, 2023
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #584 (a27b330) into main (abfeaf3) will increase coverage by 0.05%.
The diff coverage is 76.47%.

@@            Coverage Diff             @@
##             main     #584      +/-   ##
==========================================
+ Coverage   90.59%   90.64%   +0.05%     
==========================================
  Files         173      173              
  Lines        5925     5925              
  Branches      758      757       -1     
==========================================
+ Hits         5368     5371       +3     
+ Misses        397      395       -2     
+ Partials      160      159       -1     
Files Changed Coverage Δ
...ingBodyBuilders/NewValueTupleMappingBodyBuilder.cs 75.52% <69.23%> (+1.20%) ⬆️
src/Riok.Mapperly.Abstractions/MapperAttribute.cs 100.00% <100.00%> (ø)
...pingBodyBuilders/ObjectMemberMappingBodyBuilder.cs 100.00% <100.00%> (ø)
...xistingTarget/NullDelegateExistingTargetMapping.cs 85.71% <100.00%> (ø)
...berMappings/MemberNullDelegateAssignmentMapping.cs 54.54% <100.00%> (+1.42%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@latonz latonz force-pushed the 98-null-mapping-strategy branch 3 times, most recently from 408cc93 to a5b8247 Compare July 24, 2023 19:36
@latonz latonz requested review from CommonGuy and ni507 July 24, 2023 19:37
ni507
ni507 previously approved these changes Jul 25, 2023
@latonz latonz requested a review from ni507 July 25, 2023 16:10
@latonz latonz force-pushed the 98-null-mapping-strategy branch 2 times, most recently from 3b1a33e to b1d479f Compare July 25, 2023 19:17
@latonz latonz enabled auto-merge (squash) July 25, 2023 20:01
@latonz latonz merged commit 0ccc734 into riok:main Jul 26, 2023
13 of 14 checks passed
@latonz latonz deleted the 98-null-mapping-strategy branch July 26, 2023 05:50
@github-actions
Copy link

🎉 This PR is included in version 2.9.0-next.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement NullPropertyMappingStrategy to allow more flexibility when encountering null values
3 participants