Exemple #1
0
            public async Task CanExecuteWithSerializer()
            {
                var key = Guid.NewGuid().ToString("N");

                _db.JsonSet(key, "{\"hello\": \"world\", \"goodnight\": {\"value\": \"moon\"}}");

                ExampleHelloWorld result = await _db.JsonGetAsync <ExampleHelloWorld>(key);

                Assert.NotNull(result);
                Assert.Equal("world", result.Hello);
                Assert.Equal("moon", result.GoodNight.Value);
            }
            public async Task CanExecuteWithSerializer()
            {
                var key = Guid.NewGuid().ToString("N");

                var obj = new ExampleHelloWorld
                {
                    Hello = "World",

                    GoodNight = new ExampleHelloWorld.InnerExample
                    {
                        Value = "Moon"
                    }
                };

                var result = await _db.JsonSetAsync(key, obj);

                Assert.True(result);
            }