Skip to content

Commit

Permalink
chore: add existing type models
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMakkison committed Nov 24, 2023
1 parent 1931d85 commit 5b2274f
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Riok.Mapperly.Abstractions;
using Riok.Mapperly.IntegrationTests.Dto;
using Riok.Mapperly.IntegrationTests.Models;
using Riok.Mapperly.IntegrationTests.Models.ExistingObjects;

namespace Riok.Mapperly.IntegrationTests.Mapper
{
Expand Down Expand Up @@ -91,6 +92,15 @@ public static void MapExistingList(List<string> src, List<int> dst)

public static partial TTarget MapGeneric<TSource, TTarget>(TSource source);

#if NET7_0_OR_GREATER
[MapDerivedType<ExistingObjectTypeA, ExistingObjectTypeADto>]

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / build

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / build

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / build

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / build

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / MappingBenchmarks

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / MappingBenchmarks

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / test

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / test

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / test

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / test

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / SourceGeneratorBenchmarks

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeA is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase

Check failure on line 96 in test/Riok.Mapperly.IntegrationTests/Mapper/StaticTestMapper.cs

View workflow job for this annotation

GitHub Actions / SourceGeneratorBenchmarks

Derived source type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectTypeB is not assignable to parameter type Riok.Mapperly.IntegrationTests.Models.ExistingObjects.ExistingObjectBase
[MapDerivedType<ExistingObjectTypeB, ExistingObjectTypeBDto>]
#else
[MapDerivedType(typeof(ExistingObjectTypeA), typeof(ExistingObjectTypeADto))]
[MapDerivedType(typeof(ExistingObjectTypeB), typeof(ExistingObjectTypeBDto))]
#endif
public static partial void MapToDerivedExisting(ExistingObjectBase source, ExistingObjectBaseDto target);

[MapEnum(EnumMappingStrategy.ByName)]
public static partial TestEnumDtoByName MapToEnumDtoByName(TestEnum v);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Riok.Mapperly.IntegrationTests.Models.ExistingObjects
{
public class ExistingObjectBase
{
public int Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Riok.Mapperly.IntegrationTests.Models.ExistingObjects
{
public class ExistingObjectBaseDto
{
public int Value { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Riok.Mapperly.IntegrationTests.Models.ExistingObjects
{
public class ExistingObjectTypeA
{
public int ValueA { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Riok.Mapperly.IntegrationTests.Models.ExistingObjects
{
public class ExistingObjectTypeADto
{
public int ValueA { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Riok.Mapperly.IntegrationTests.Models.ExistingObjects
{
public class ExistingObjectTypeB
{
public int ValueB { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Riok.Mapperly.IntegrationTests.Models.ExistingObjects
{
public class ExistingObjectTypeBDto
{
public int ValueB { get; set; }
}
}

0 comments on commit 5b2274f

Please sign in to comment.