mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-28 23:01:53 +03:00
a297460f37
small improvements
21 lines
484 B
C#
21 lines
484 B
C#
using Newtonsoft.Json;
|
|
|
|
namespace WPImageCaching
|
|
{
|
|
public static class SerializationHelper
|
|
{
|
|
public static T Deserialize<T>(string serialized)
|
|
{
|
|
if (string.IsNullOrEmpty(serialized))
|
|
return default(T);
|
|
|
|
return JsonConvert.DeserializeObject<T>(serialized);
|
|
}
|
|
|
|
public static string Serialize<T>(T obj)
|
|
{
|
|
return JsonConvert.SerializeObject(obj);
|
|
}
|
|
|
|
}
|
|
} |