Moves as much as possible from Models/Packaging, Models/PublishedContent, Models/Entities, Models/Membership
This commit is contained in:
@@ -4,19 +4,25 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Umbraco.Core.Serialization
|
||||
{
|
||||
public class JsonNetSerializer : IJsonSerializer
|
||||
{
|
||||
private static readonly JsonConverter[] _defaultConverters = new JsonConverter[]
|
||||
{
|
||||
new StringEnumConverter()
|
||||
};
|
||||
|
||||
public string Serialize(object input)
|
||||
{
|
||||
return JsonConvert.SerializeObject(input);
|
||||
return JsonConvert.SerializeObject(input, _defaultConverters);
|
||||
}
|
||||
|
||||
public T Deserialize<T>(string input)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(input);
|
||||
return JsonConvert.DeserializeObject<T>(input, _defaultConverters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user