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
using Nelibur.ObjectMapper;
using Riok.Mapperly.Abstractions;
using WireMock.Admin.Mappings;
using WireMock.Admin.Settings;
using WireMock.Settings;
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()
{
TinyMapper.Bind<ProxyAndRecordSettings, ProxyAndRecordSettingsModel>();
TinyMapper.Bind<WebProxySettings, WebProxySettingsModel>();
TinyMapper.Bind<WebProxySettings, WebProxyModel>();
TinyMapper.Bind<ProxyUrlReplaceSettings, ProxyUrlReplaceSettingsModel>();
public static partial ProxyAndRecordSettings? Map(ProxyAndRecordSettingsModel? model);
TinyMapper.Bind<ProxyAndRecordSettingsModel, ProxyAndRecordSettings>();
TinyMapper.Bind<WebProxySettingsModel, WebProxySettings>();
TinyMapper.Bind<WebProxyModel, WebProxySettings>();
TinyMapper.Bind<ProxyUrlReplaceSettingsModel, ProxyUrlReplaceSettings>();
}
public static partial ProxyUrlReplaceSettingsModel? Map(ProxyUrlReplaceSettings? instance);
public ProxyAndRecordSettingsModel? Map(ProxyAndRecordSettings? instance)
{
return instance == null ? null : TinyMapper.Map<ProxyAndRecordSettingsModel>(instance);
}
public static partial ProxyUrlReplaceSettings? Map(ProxyUrlReplaceSettingsModel? model);
public ProxyAndRecordSettings? Map(ProxyAndRecordSettingsModel? model)
{
return model == null ? null : TinyMapper.Map<ProxyAndRecordSettings>(model);
}
public static partial WebProxyModel? Map(WebProxySettings? instance);
public ProxyUrlReplaceSettingsModel? Map(ProxyUrlReplaceSettings? instance)
{
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);
}
public static partial WebProxySettings? Map(WebProxyModel? model);
}

View File

@@ -63,10 +63,10 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NJsonSchema.Extensions" Version="0.1.0" />
<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="JmesPath.Net" Version="1.0.125" />
<PackageReference Include="AnyOf" Version="0.3.0" />
<PackageReference Include="TinyMapper" Version="3.0.3" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard1.3' ">