23 lines
574 B
C#
23 lines
574 B
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace SqlSugar
|
|
{
|
|
public class SerializeService:ISerializeService
|
|
{
|
|
public string SerializeObject(object value)
|
|
{
|
|
return JsonConvert.SerializeObject(value);
|
|
}
|
|
|
|
public T DeserializeObject<T>(string value)
|
|
{
|
|
var jSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
|
return JsonConvert.DeserializeObject<T>(value, jSetting);
|
|
}
|
|
}
|
|
}
|