Exemplo n.º 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();
        }
Exemplo n.º 2
0
        public void GET_SET_Protobuf()
        {
            ProtobufKey rk = "henry_protobuf";
            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);
        }
Exemplo n.º 3
0
        public void Set_Get_Json()
        {
            //string key = "get_set_json";
            UserBase1 user = new UserBase1();

            user.Country = "cn";
            user.Name    = "john";
            user.City    = "wx";

            //ProtobufList<UserBase1> proList = new ProtobufList<UserBase1>();
            //proList.Add()

            ProtobufKey k = new ProtobufKey("ss");//还必须加上key的名字啊

            k.Set(user);
            UserBase1 us = k.Get <UserBase1>();

            Assert.AreEqual("john", us.Name);
        }
Exemplo n.º 4
0
        public void Set_Get_Json()
        {
            //string key = "get_set_json";
            UserBase1 user = new UserBase1();
            user.Country = "cn";
            user.Name = "john";
            user.City = "wx";

            //ProtobufList<UserBase1> proList = new ProtobufList<UserBase1>();
            //proList.Add()

            ProtobufKey k = new ProtobufKey("ss");//还必须加上key的名字啊
            k.Set(user);
            UserBase1 us = k.Get<UserBase1>();
            Assert.AreEqual("john", us.Name);
        }