mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
added custom IntConverter to get around the mono bug
http://json.codeplex.com/workitem/24176
This commit is contained in:
parent
904061c2f0
commit
41c5619d1b
15 changed files with 122 additions and 56 deletions
|
@ -1,13 +1,13 @@
|
|||
using Newtonsoft.Json;
|
||||
using NzbDrone.Common.Serializer;
|
||||
|
||||
namespace NzbDrone.Test.Common
|
||||
{
|
||||
public static class ObjectExtentions
|
||||
{
|
||||
public static T JsonClone<T>(this T source)
|
||||
public static T JsonClone<T>(this T source) where T : new()
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(source);
|
||||
return JsonConvert.DeserializeObject<T>(json);
|
||||
var json = source.ToJson();
|
||||
return Json.Deserialize<T>(json);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue