This commit is contained in:
skx
2020-12-05 20:16:34 +08:00
parent 4621b46c11
commit 47c292fe3e
4 changed files with 330 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
using System;
namespace CacheTest
{
class Program
{
static void Main(string[] args)
{
SugarCache cache = new SugarCache();
cache.Add("a", "1");
var x = cache.Get<string>("a");
cache.Add("a2", "11",5);
var x2 = cache.Get<string>("a2");
var isa= cache.ContainsKey<string>("a2");
var allKeys = cache.GetAllKey<string>();
var testr=cache.GetOrCreate<string>("a33",()=> { return "aaa"; },10);
cache.Remove<string>("aaaaaaaa");
cache.Remove<string>("a");
Console.WriteLine("Hello World!");
}
}
}