title: Calling base constructor after body of current constructor
body: <p>I am customizing one of the code generating templates for my Telerik OpenAccess ORM library. Due to business rules, I am having to put my user name and password to connect to the database in a config file as an encrypted string. I don't have the authority over this requirement and as such I <strong>cannot avoid it</strong>.</p>
  
  <p>What I have done is create a singleton class that provides the decrypted credentials and modified the code generation template to use it. Here is part of the template I am modifying:</p>
  
  <pre><code>public &lt;#= contextClass.Name #&gt;()
          :base(connectionStringName, backend, metadataSource)
  {
      Credentials credentials = Credentials.Instance;
      string connectionString = String.Format("DATA SOURCE={0};PASSWORD={1};PERSIST SECURITY INFO=True;USER ID={2}", 
                                               credentials.DatabaseServer,
                                               credentials.DatabasePassword,
                                               credentials.DatabaseUser);
  
  }
  
  public &lt;#= contextClass.Name #&gt;(string connection)
      :base(connection, backend, metadataSource)
  { }
  
  public &lt;#= contextClass.Name #&gt;(BackendConfiguration backendConfiguration)
      :base(connectionStringName, backendConfiguration, metadataSource)
  { }
  
  //More constructors.....
  </code></pre>
  
  <p>All of the templates generate constructors with no code inside the body. What I want is to create my connection string and then use that for the constructor of the base class (<code>OpenAccessContext</code>). I would like this to be my default constructor as you can tell by the parameterless constructor I modified -- <code>public &lt;#= contextClass.Name #&gt;()</code></p>
  
  <p>What has me stumped is how to create this string and then use it in the constructor of my base class. Any ideas?</p>