title: How to create a custom partial class with T4 template?
body: <p>I want a template which somehow accepts a <code>class_name</code> property and creates a class, name of which is the value of <code>class_name</code></p>
  
  <p>Ideally, I should be able to execute my template inside <code>MyClass.cs</code> containing definition for <code>public partial class MyClass</code>, and that would set <code>class_name</code> to <code>MyClass</code></p>
  
  <p>This template</p>
  
  <pre><code>&lt;#@ template debug="false" hostspecific="false" language="C#" #&gt;
  &lt;#@ assembly name="System.Core" #&gt;
  &lt;#@ import namespace="System.Linq" #&gt;
  &lt;#@ import namespace="System.Text" #&gt;
  &lt;#@ import namespace="System.Collections.Generic" #&gt;
  &lt;#@ output extension=".cs" #&gt;
  
  public partial class &lt;#=class_name #&gt;
  {
  
  }
  </code></pre>
  
  <p>produces an error:</p>
  
  <pre><code>Error   1   Compiling transformation: The name 'class_name' does not exist in the current context
  </code></pre>
  
  <p>How do I put a definition of a <code>class_name</code> into it?</p>