Serialize() public static method

public static Serialize ( object graph, object>.Action action ) : byte[]
graph object
action object>.Action
return byte[]
        public byte[] Serialize(object graph)
        {
            if (graph == null)
            {
                graph = new NullValueType();
            }

            return(StreamHelper.Serialize(graph,
                                          (s, g) => GetFormatter().Serialize(s, g)));
        }
Ejemplo n.º 2
0
 public byte[] Serialize(object graph)
 {
     return(StreamHelper.Serialize(graph,
                                   (s, g) => new NetDataContractSerializer().Serialize(s, g)));
 }
Ejemplo n.º 3
0
 public byte[] Serialize(object graph)
 {
     return(StreamHelper.Serialize(graph,
                                   (s, g) => new DataContractSerializer(Type).WriteObject(s, g)));
 }