Mapster
Mapster copied to clipboard
Mapster.Tool does not translate Nullable ICollection in domain to a nullable ICollection in the generated class
I have two domain classes
Friend.cs
public record Friend
{
public string Name { get; init; }
}
Me.cs
public record Me
{
public string Name { get; init; } = null!;
public Province Location { get; init; } = null!;
public Company Job { get; init; } = null!;
public ICollection<Friend>? Friends { get; init; }
}
When MeDto.g.cs is generated, the Friends collection is not a nullable property
public partial record MeDto
{
public string Name { get; set; }
public ProvinceDto Location { get; set; }
public CompanyDto Job { get; set; }
public ICollection<FriendDto> Friends { get; set; }
}
Code to reproduce the issue at
https://github.com/aurasolutions/mapster-issues.git
In order to identify issues that are still active, we are closing issues that we believe are either resolved or are dormant. If your issue is still active then please reopen. Thanks.