public static void SerializeToStream(object request, Stream stream)
 {
     using (var writer = new StreamWriter(stream))
     {
         YamlSerializer.SerializeToWriter(request, writer);
     }
 }
 public static object DeserializeFromStream(Type type, Stream fromStream)
 {
     using (var reader = new StreamReader(fromStream))
     {
         return(YamlSerializer.SerializeFromReader(type, reader));
     }
 }
 public static void SerializeToStream(IRequest requestContext, object request, Stream stream)
 {
     YamlSerializer.SerializeToStream(request, stream);
 }