예제 #1
0
        static void Main(string[] args)
        {
            StringKey key    = "JOHN";
            string    Remark = "johnwonder";

            key.Set(Remark);
            Console.WriteLine(key.Get <string>());


            JsonKey  jk = "john_json";
            UserBase ub = new UserBase();

            ub.Name    = "john360";
            ub.City    = "wx";
            ub.Country = "cn";
            ub.Age     = 10;
            jk.Set(ub);

            Console.WriteLine(jk.Get <UserBase>().Name);
            //ProtobufList
            ProtobufKey rk = "john_protobuf";

            rk.Delete();
            UserBase1 userB = new UserBase1();

            userB.Name    = "john123";
            userB.City    = "wx";
            userB.Country = "cn";
            userB.Age     = 10;
            rk.Set(userB);

            Console.WriteLine(rk.Get <UserBase1>().Name);
            Console.ReadLine();
        }
예제 #2
0
        public void GET_SET_Json()
        {
            JsonKey  rk = "henry_json";
            UserBase ub = new UserBase();

            ub.Name    = "henryfan";
            ub.City    = "gz";
            ub.Counrty = "cn";
            ub.Age     = 10;
            rk.Set(ub);
            Assert.AreEqual(ub.Name, rk.Get <UserBase>().Name);
        }