Example #1
0
        public string DehydrateValue(object obj, IGraph uow)
        {
            Condition.Requires(obj).IsNotNull();
            var name = obj.GetType().AssemblyQualifiedName;
            var data = BinarySerializationUtil.Serialize(obj);

            return(LengthEncoder.LengthEncodeList(name, data));
        }
Example #2
0
 public string DehydrateValue(object obj, IGraph uow)
 {
     var ser = new BinarySerializationUtil();
     var data = ser.Serialize(obj);
     //prepend the assembly qualified type name
     data = obj.GetType().AssemblyQualifiedName + GraphingDelimiters.DELIM_LEVEL1 + data;
     
     return data;
 }
Example #3
0
        public string DehydrateValue(object obj, IGraph uow)
        {
            var ser  = new BinarySerializationUtil();
            var data = ser.Serialize(obj);

            //prepend the assembly qualified type name
            data = obj.GetType().AssemblyQualifiedName + GraphingDelimiters.DELIM_LEVEL1 + data;

            return(data);
        }
Example #4
0
 public override string ToString()
 {
     return(BinarySerializationUtil.Serialize(this));
 }
 /// <summary>
 /// 自动序列化
 /// </summary>
 /// <typeparam name="T">对象类型</typeparam>
 /// <param name="obj">对象</param>
 /// <returns></returns>
 protected virtual byte[] AutoSerialize <T>(T obj)
 {
     return(BinarySerializationUtil.Serialize(obj));
 }