title: Classes in razor engine template
body: <p>Is it possible to create classes within a template? Something like...</p>
  
  <pre><code>@{
      public class MyClass {
          public MyClass() {
              Three = new List&lt;string&gt;();
          }
  
          public string One { get; set; }
          public int Two { get; set; }
          public List&lt;string&gt; Three { get; set; }
      }
  }
  </code></pre>
  
  <p>Currently I get "Unable to compile template. Check the Errors list for details." when I try to do this. I would like to take XML content and use XmlSerializer to create an instance of MyClass within the template. I can't do the deserialization before hand and shove it into the model because the classes could vary depending on the template.</p>