using FWindSoft.Data; using FWindSoft.SystemExtensions; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Test.CacheItemsTest { public class CacheItemsUtils { public static void Test() { CacheItems CacheItems = new CacheItems((d) => { return new Dictionary() { { "1", 1 }, { "2", 2 } }; }, (d) => { return new Dictionary() { { d.Split(':')[0], d.Split(':')[0].ToInt() } }; },(d)=>d.Split(':')[0]); var result1 = CacheItems.GetItem("1"); var result2 = CacheItems.GetItem("2"); var result3 = CacheItems.GetItem("6"); var result4 = CacheItems.GetItem("10"); var result5 = CacheItems.GetItem("1"); var result6 = CacheItems.GetItem("13:B"); } } }