title: C# CodeDom Convert between types
body: <p>I am trying to use CodeDom to produce the following line of code:</p>
  
  <pre><code>object o = (object)bytes
  </code></pre>
  
  <p><strong>Where "bytes" represents a byte array: byte[] bytes = null;</strong></p>
  
  <p>I could use the VariableDeclaration method or possibly even the CodeAssign method to generate the <em>left</em> side of this line, but how can I create the right side of this line?</p>
  
  <p>I am open to any suggestions - thank you!</p>
  
  <p>Evan</p>