diff --git a/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs b/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs index 608bd41..0ea91cb 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs +++ b/WebSiteCode/Cmdjy/Cmdjy/Bll/Cache.cs @@ -90,10 +90,12 @@ namespace Cmdjy.Bll } private static string toJson(object value) { + if(value == null) return null; return JsonConvert.SerializeObject(value); } - private static T fromJson(string value) { + private static T fromJson(string value) where T : class { + if(value == null) return null; return JsonConvert.DeserializeObject(value); } } diff --git a/WebSiteCode/Cmdjy/Cmdjy/Web.config b/WebSiteCode/Cmdjy/Cmdjy/Web.config index 7124276..b071647 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Web.config +++ b/WebSiteCode/Cmdjy/Cmdjy/Web.config @@ -17,7 +17,7 @@ - +