Example #1
0
 public static async Task SetString(this IKeyValueCache cache, string key, string str, DateTime?expiresIn = null)
 {
     if (str == null)
     {
         await cache.Remove(key);
     }
     else
     {
         var bytes = Encoding.UTF8.GetBytes(str);
         await cache.SetBytes(key, bytes, expiresIn);
     }
 }
Example #2
0
 public void Save(Translation translation)
 {
     _session.Save(translation);
     _keyValueCache.Remove(CacheKey);
 }