Skip to content

Unflattening and property type initialization #307

Closed Answered by latonz
forrestab asked this question in Q&A
Discussion options

You must be logged in to vote

If nullable reference types are enabled for Mapperly, Mapperly does not initialize proeprties marked as non-nullable.
If you look for example at these two test:

[Fact]
public void ManualUnflattenedProperty()
{
var source = TestSourceBuilder.MapperWithBodyAndTypes(
"[MapProperty($\"MyValueId\", \"Value.Id\")] partial B Map(A source);",
"class A { public string MyValueId { get; set; } }",
"class B { public C Value { get; set; } }",
"class C { public string Id { get; set; }");
TestHelper.GenerateMapper(source)
.Should()
.H…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by latonz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants