예제 #1
0
        public void DbMap5()
        {
            var ips = new List <IPAddress> {
                IPAddress.Parse("192.168.1.1"),
                IPAddress.Parse("192.168.1.2")
            };

            var value = new DbValue(AttributeCollection.FromObject(new Machine {
                Id  = 1,
                Ips = ips
            }));

            Assert.Equal(@"{
  ""M"": {
    ""id"": {
      ""N"": ""1""
    },
    ""ips"": {
      ""L"": [
        {
          ""B"": ""wKgBAQ==""
        },
        {
          ""B"": ""wKgBAg==""
        }
      ]
    }
  }
}", value.ToJson().ToString());
        }
예제 #2
0
        public void DbMap()
        {
            var value = new DbValue(new AttributeCollection {
                { "a", 1 },
                { "b", "boat" }
            });


            Assert.Equal(@"{
  ""M"": {
    ""a"": {
      ""N"": ""1""
    },
    ""b"": {
      ""S"": ""boat""
    }
  }
}", value.ToJson().ToString());
        }