mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-29 11:02:07 +03:00
friends caching
small improvements
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user