Incorrect data being returned for nonexistent primitive datatypes

default(T) returns non null value for primitive datatypes, this causes CachingExtensions.Get<T> never to call the factory method.
This commit is contained in:
Another Developer 2016-03-03 09:27:20 -05:00
parent 23449d9b32
commit 008edc46ef

View File

@ -38,7 +38,7 @@ namespace Orchard.Redis.Caching {
public object Get<T>(string key) {
var json = Database.StringGet(GetLocalizedKey(key));
if(String.IsNullOrEmpty(json)) {
return default(T);
return null;
}
return JsonConvert.DeserializeObject<T>(json);
}