Compare commits

...

1 Commits

Author SHA1 Message Date
Stef Heyenrath
7880bfcc63 [WIP] - Riok.Mapperly 2024-08-15 13:51:44 +02:00
2 changed files with 10 additions and 42 deletions

View File

@@ -1,56 +1,24 @@
// Copyright © WireMock.Net // Copyright © WireMock.Net
using Nelibur.ObjectMapper; using Riok.Mapperly.Abstractions;
using WireMock.Admin.Mappings; using WireMock.Admin.Mappings;
using WireMock.Admin.Settings; using WireMock.Admin.Settings;
using WireMock.Settings; using WireMock.Settings;
namespace WireMock.Util; namespace WireMock.Util;
internal sealed class TinyMapperUtils [Mapper]
internal static partial class TinyMapperUtils
{ {
public static TinyMapperUtils Instance { get; } = new(); public static partial ProxyAndRecordSettingsModel? Map(ProxyAndRecordSettings? instance);
private TinyMapperUtils() public static partial ProxyAndRecordSettings? Map(ProxyAndRecordSettingsModel? model);
{
TinyMapper.Bind<ProxyAndRecordSettings, ProxyAndRecordSettingsModel>();
TinyMapper.Bind<WebProxySettings, WebProxySettingsModel>();
TinyMapper.Bind<WebProxySettings, WebProxyModel>();
TinyMapper.Bind<ProxyUrlReplaceSettings, ProxyUrlReplaceSettingsModel>();
TinyMapper.Bind<ProxyAndRecordSettingsModel, ProxyAndRecordSettings>(); public static partial ProxyUrlReplaceSettingsModel? Map(ProxyUrlReplaceSettings? instance);
TinyMapper.Bind<WebProxySettingsModel, WebProxySettings>();
TinyMapper.Bind<WebProxyModel, WebProxySettings>();
TinyMapper.Bind<ProxyUrlReplaceSettingsModel, ProxyUrlReplaceSettings>();
}
public ProxyAndRecordSettingsModel? Map(ProxyAndRecordSettings? instance) public static partial ProxyUrlReplaceSettings? Map(ProxyUrlReplaceSettingsModel? model);
{
return instance == null ? null : TinyMapper.Map<ProxyAndRecordSettingsModel>(instance);
}
public ProxyAndRecordSettings? Map(ProxyAndRecordSettingsModel? model) public static partial WebProxyModel? Map(WebProxySettings? instance);
{
return model == null ? null : TinyMapper.Map<ProxyAndRecordSettings>(model);
}
public ProxyUrlReplaceSettingsModel? Map(ProxyUrlReplaceSettings? instance) public static partial WebProxySettings? Map(WebProxyModel? model);
{
return instance == null ? null : TinyMapper.Map<ProxyUrlReplaceSettingsModel>(instance);
}
public ProxyUrlReplaceSettings? Map(ProxyUrlReplaceSettingsModel? model)
{
return model == null ? null : TinyMapper.Map<ProxyUrlReplaceSettings>(model);
}
public WebProxyModel? Map(WebProxySettings? instance)
{
return instance == null ? null : TinyMapper.Map<WebProxyModel>(instance);
}
public WebProxySettings? Map(WebProxyModel? model)
{
return model == null ? null : TinyMapper.Map<WebProxySettings>(model);
}
} }

View File

@@ -63,10 +63,10 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NJsonSchema.Extensions" Version="0.1.0" /> <PackageReference Include="NJsonSchema.Extensions" Version="0.1.0" />
<PackageReference Include="NSwag.Core" Version="13.16.1" /> <PackageReference Include="NSwag.Core" Version="13.16.1" />
<PackageReference Include="Riok.Mapperly" Version="3.6.0" />
<PackageReference Include="SimMetrics.Net" Version="1.0.5" /> <PackageReference Include="SimMetrics.Net" Version="1.0.5" />
<PackageReference Include="JmesPath.Net" Version="1.0.125" /> <PackageReference Include="JmesPath.Net" Version="1.0.125" />
<PackageReference Include="AnyOf" Version="0.3.0" /> <PackageReference Include="AnyOf" Version="0.3.0" />
<PackageReference Include="TinyMapper" Version="3.0.3" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard1.3' "> <ItemGroup Condition=" '$(TargetFramework)' != 'netstandard1.3' ">