-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Improve null handling #1614
Comments
I think that when doing this task, you should also take into account similar conversions from #1117:
Also pay attention to the results of these two tests: mapperly/test/Riok.Mapperly.Tests/Mapping/StaticMethodConversionTest.cs Lines 135 to 146 in 39376fa
|
Can null value assignments be configured separately for each property? [AllowNullPropertyAssignment(false, Include = ["ArrayProp1", "ListProp2"])]
public static partial void UpdateEntity(this UpdateDto dto, MyEntity entity); This way, null values can be used in the collection navigation properties to indicate that the collection navigation properties are not modified when update entity using EF Core. |
This is not yet possible. |
Currently, Mapperly upgrades non-nullable reference types to annotated nullable reference types early in the mapping pipeline. Additionally, when nullables are involved, Mapperly incorporates null handling into the mapping process and continues the pipeline with non-nullable types. This approach centralizes null handling, making it simple and consistent.
However, this design has led to several bugs, indicating the need for a more robust solution. We need to define a clear concept to address these issues and improve the handling of nullable reference types without compromising simplicity or maintainability.
Related Bugs:
See also #1117 (comment).
The text was updated successfully, but these errors were encountered: