Permalink
Browse files

Merge branch 'master' of http://www.github.com/websilk/home

  • Loading branch information...
markentingh committed May 25, 2017
2 parents fa85d45 + 9397d6e commit ccc8cac1cabf6106321af7fe49dd07c7934475bd
Showing with 199 additions and 129 deletions.
  1. +1 −1 App/CSS/tapestry
  2. +14 −0 App/Core/Server.cs
  3. +184 −128 App/Core/Sql.cs
Submodule tapestry updated 3 files
+31 −57 less/theme.less
+0 −12 less/util.less
+131 −160 tapestry.less
View
@@ -131,6 +131,20 @@ public void SaveToCache(string key, string value)
Cache.Add(key, value);
}
}
public T GetFromCache<T>(string key, Func<T> value, bool serialize = true)
{
if(Cache[key] == null)
{
var obj = value();
SaveToCache(key, serialize ? S.Util.Serializer.WriteObjectAsString(obj) : obj);
return obj;
}
else
{
return serialize ? (T)S.Util.Serializer.ReadObject((string)Cache[key], typeof(T)) : (T)Cache[key];
}
}
#endregion
}
}
Oops, something went wrong.

0 comments on commit ccc8cac

Please sign in to comment.