mirror of
https://github.com/FastTunnel/FastTunnel.git
synced 2025-02-08 02:39:29 +08:00
del useless code
This commit is contained in:
parent
632976f831
commit
6aafc43fb5
|
@ -32,8 +32,4 @@
|
|||
<PackageReference Include="System.IO.Pipelines" Version="5.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Exceptions\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user