12345678910111213141516171819202122232425262728293031 |
- 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<string,int> CacheItems = new CacheItems<string,int>((d) =>
- {
- return new Dictionary<string, int>() { { "1", 1 }, { "2", 2 } };
- }, (d) =>
- {
- return new Dictionary<string, int>() { { 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");
- }
- }
- }
|