You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
488 B

2 years ago
  1. using Newtonsoft.Json;
  2. namespace SqlSugar
  3. {
  4. public class SerializeService:ISerializeService
  5. {
  6. public string SerializeObject(object value)
  7. {
  8. return JsonConvert.SerializeObject(value);
  9. }
  10. public T DeserializeObject<T>(string value)
  11. {
  12. var jSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
  13. return JsonConvert.DeserializeObject<T>(value, jSetting);
  14. }
  15. }
  16. }