示例#1
0
        public void TestMyExtension()
        {
            var cache = new Microsoft.Extensions.Caching.Memory.MemoryCache(new MemoryCacheOptions());

            cache.MySet("user", new User {
                Name = "Foo"
            });
            var f = cache.MyGet <User>("user");

            Assert.Equal("Foo", f.Name);

            f.Name = "Bar";
            var b = cache.MyGet <User>("user");

            Assert.Equal("Foo", b.Name);
        }