59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
|
using Newtonsoft.Json;
|
|||
|
using Newtonsoft.Json.Converters;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Globalization;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace Model
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
public static class Serialize
|
|||
|
{
|
|||
|
public static string ToJson(this MasterDataAdPostList self)
|
|||
|
{
|
|||
|
return JsonConvert.SerializeObject(self, Model.Converter.Settings);
|
|||
|
}
|
|||
|
|
|||
|
public static string ToJson(this MasterData_ad_orgList self)
|
|||
|
{
|
|||
|
return JsonConvert.SerializeObject(self, Model.Converter.Settings);
|
|||
|
}
|
|||
|
public static string ToJson(this MasterDataDepList self)
|
|||
|
{
|
|||
|
return JsonConvert.SerializeObject(self, Model.Converter.Settings);
|
|||
|
}
|
|||
|
public static string ToJson(this MasterDataPersonList self)
|
|||
|
{
|
|||
|
return JsonConvert.SerializeObject(self, Model.Converter.Settings);
|
|||
|
}
|
|||
|
public static string ToJson(this MasterDataPostList self)
|
|||
|
{
|
|||
|
return JsonConvert.SerializeObject(self, Model.Converter.Settings);
|
|||
|
}
|
|||
|
public static string ToJson(this UserInfo self)
|
|||
|
{
|
|||
|
return JsonConvert.SerializeObject(self, Model.Converter.Settings);
|
|||
|
}
|
|||
|
public static string ToJson(Model.MasterDataPcEp self)
|
|||
|
{
|
|||
|
return JsonConvert.SerializeObject(self, Model.Converter.Settings);
|
|||
|
}
|
|||
|
}
|
|||
|
internal static class Converter
|
|||
|
{
|
|||
|
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
|||
|
{
|
|||
|
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
|||
|
DateParseHandling = DateParseHandling.None,
|
|||
|
Converters =
|
|||
|
{
|
|||
|
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
|||
|
},
|
|||
|
};
|
|||
|
}
|
|||
|
}
|