Esempio n. 1
0
 public static byte[] Serialize(this RequestCommand requestCommand, CommandHeader commandHeader)
 {
     if (commandHeader == CommandHeader.Yes)
     {
         return(Serialize(requestCommand.Contents).AddHeader(requestCommand.CommandId));
     }
     return(Serialize(requestCommand.Contents));
 }
Esempio n. 2
0
        public static byte[] Serialize(this RequestCommand requestCommand, CommandHeader commandHeader, out string networkPayloadHash)
        {
            if (commandHeader == CommandHeader.Yes)
            {
                var bodyPart = Serialize(requestCommand.Contents);
                networkPayloadHash = NetworkPayloadHash.ComputeAsGuidString(bodyPart);
                return(bodyPart.AddHeader(requestCommand.CommandId));
            }

            var body = Serialize(requestCommand.Contents);

            networkPayloadHash = NetworkPayloadHash.ComputeAsGuidString(body);
            return(body);
        }