Skip to content

Commit

Permalink
Fix build for net6.0 and net 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TonEnfer committed Dec 8, 2024
1 parent 5937091 commit c9c8845
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/Riok.Mapperly.IntegrationTests/Dto/TestObjectDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public TestObjectDto(int ctorValue, int unknownValue = 10, int ctorValue2 = 100)
public IReadOnlySet<int> IReadOnlySet { get; set; } = new HashSet<int>();
#endif

public HashSet<int> HashSet { get; set; } = [];
public HashSet<int> HashSet { get; set; } = new();

public SortedSet<int> SortedSet { get; set; } = [];
public SortedSet<int> SortedSet { get; set; } = new();

public TestEnumDtoByValue EnumValue { get; set; }

Expand Down Expand Up @@ -131,7 +131,7 @@ public TestObjectDto(int ctorValue, int unknownValue = 10, int ctorValue2 = 100)

public TimeOnly DateTimeValueTargetTimeOnly { get; set; }

public byte[] ToByteArrayWithInstanceMethod { get; set; } = [];
public byte[]? ToByteArrayWithInstanceMethod { get; set; }

public int WithCreateMethod { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ public partial byte[] ConvertWithInstanceMethod(global::System.Guid id)
{
target.SubObject = null;
}
target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod);
if (dto.ToByteArrayWithInstanceMethod != null)
{
target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod);
}
target.WithCreateMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.Create(dto.WithCreateMethod);
target.WithCreateFromMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.CreateFrom(dto.WithCreateFromMethod);
target.WithFromSingleMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.FromSingle(dto.WithFromSingleMethod);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,10 @@ public static partial void MapIdTargetFirst(global::Riok.Mapperly.IntegrationTes
{
target.SubObject = null;
}
target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod);
if (dto.ToByteArrayWithInstanceMethod != null)
{
target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod);
}
target.WithCreateMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.Create(dto.WithCreateMethod);
target.WithCreateFromMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.CreateFrom(dto.WithCreateFromMethod);
target.WithFromSingleMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.FromSingle(dto.WithFromSingleMethod);
Expand Down

0 comments on commit c9c8845

Please sign in to comment.