-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not resolve existing one sideded loose nullable property mapp…
…ings (#1090)
- Loading branch information
Showing
4 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...blePropertyWithAnotherNullableToNonNullableMappingShouldDirectAssign#Mapper.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//HintName: Mapper.g.cs | ||
// <auto-generated /> | ||
#nullable enable | ||
public partial class Mapper | ||
{ | ||
[global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "0.0.1.0")] | ||
public static partial global::ADest? Map(global::A? source) | ||
{ | ||
if (source == null) | ||
return default; | ||
var target = new global::ADest(source.Prop); | ||
return target; | ||
} | ||
|
||
[global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "0.0.1.0")] | ||
public static partial global::BDest MapToDestinationB(global::B source) | ||
{ | ||
var target = new global::BDest(MapToList(source.Prop)); | ||
return target; | ||
} | ||
|
||
[global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "0.0.1.0")] | ||
private static global::System.Collections.Generic.List<int> MapToList(global::System.Collections.Generic.IReadOnlyCollection<int?> source) | ||
{ | ||
var target = new global::System.Collections.Generic.List<int>(source.Count); | ||
foreach (var item in source) | ||
{ | ||
target.Add(item == null ? throw new System.ArgumentNullException(nameof(item)) : item.Value); | ||
} | ||
return target; | ||
} | ||
} |