update
This commit is contained in:
22
MySolution/STcpHelper/Utility/SJsonSerializerHelper.cs
Normal file
22
MySolution/STcpHelper/Utility/SJsonSerializerHelper.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace STcpHelper.Utility
|
||||
{
|
||||
public class SJsonSerializerHelper : ISSerializer
|
||||
{
|
||||
public string Serialize<T>(T obj)
|
||||
{
|
||||
return JsonConvert.SerializeObject(obj);
|
||||
}
|
||||
|
||||
public T Deserialize<T>(string str)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(str);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user