title: How do I pass a string parameter to a t4 template
body: <p>Hi I am trying to find a way to pass a normal string as a parameter to a text template.</p>
  
  <p>This is my Template code, if someone could tell me what I would need to write in c# to pass my parameters and create the class file. That would be very helpful, Thanks.</p>
  
  <pre><code>&lt;#@ template debug="false" hostspecific="true" language="C#" #&gt;
  &lt;#@ output extension=".cs" #&gt;
  &lt;#@ assembly name="System.Xml" #&gt;
  &lt;#@ assembly name="EnvDTE" #&gt;
  &lt;#@ import namespace="System.Xml" #&gt;
  &lt;#@ import namespace="System.Collections.Generic" #&gt;
  &lt;#@ parameter name="namespacename" type="System.String" #&gt;
  &lt;#@ parameter name="classname" type="System.String" #&gt;
  &lt;#
  this.OutputInfo.File(this.classname);
  #&gt;
  namespace &lt;#= this.namespacename #&gt;
  {
      using System;
      using System.Collections.Generic; 
      using System.Linq; 
      using System.Xml; 
  
      /// &lt;summary&gt;
      /// This class describes the data layer related to &lt;#= this.classname #&gt;.
      /// &lt;/summary&gt;
      /// &lt;history&gt;
      ///   &lt;change author=`Auto Generated` date=&lt;#= DateTime.Now.ToString("dd/MM/yyyy") #&gt;&gt;Original Version&lt;/change&gt;
      /// &lt;/history&gt;
      public partial class &lt;#= this.classname #&gt; : DataObject
      {
          #region constructor
  
          /// &lt;summary&gt;
          /// A constructor which allows the base constructor to attempt to extract the connection string from the config file.
          /// &lt;/summary&gt;
          public &lt;#= this.classname #&gt;() : base() {}
  
          /// &lt;summary&gt;
          /// A constructor which delegates to the base constructor to enable use of connection string.
          /// &lt;/summary&gt;
          /// &lt;param name='connectionstring`&gt;&lt;/param&gt;
          public &lt;#= this.classname #&gt;(string connectionstring) : base(connectionstring) {}
  
          #endregion
      }
  }
  </code></pre>