del useless code

This commit is contained in:
Gui.H 2023-03-22 10:17:08 +08:00
parent 632976f831
commit 6aafc43fb5
2 changed files with 0 additions and 21 deletions

View File

@ -32,8 +32,4 @@
<PackageReference Include="System.IO.Pipelines" Version="5.0.2" />
</ItemGroup>
<ItemGroup>
<Folder Include="Exceptions\" />
</ItemGroup>
</Project>

View File

@ -3,17 +3,12 @@
// You may obtain a copy of the License at
// https://github.com/FastTunnel/FastTunnel/edit/v2/LICENSE
// Copyright (c) 2019 Gui.H
#if NETCOREAPP3_1_OR_GREATER
using System.Text.Json;
#else
#endif
namespace FastTunnel.Core.Extensions
{
public static class ObjectExtensions
{
#if NETCOREAPP3_1_OR_GREATER
public static string ToJson(this object message)
{
if (message == null)
@ -24,17 +19,5 @@ namespace FastTunnel.Core.Extensions
var jsonOptions = new JsonSerializerOptions { WriteIndented = false };
return JsonSerializer.Serialize(message, message.GetType(), jsonOptions);
}
#else
public static string ToJson(this object message)
{
if (message == null)
{
return null;
}
var jsonOptions = new JsonSerializerOptions { WriteIndented = false };
return JsonSerializer.Serialize(message, message.GetType(), jsonOptions);
}
#endif
}
}