title: DotLiquid, some beginner questions/observations
body: <p>I'm investigating using <a href="http://dotliquidmarkup.org/" rel="nofollow noreferrer">dotliquid</a> to replace a home grown piece of templating code and I'm wondering about the best way to achieve my goal.</p>
  
  <p>The old code used to use sigils in the template and, together with a Dictionary, used regexes to search and replace. So you did something like this in the template file:</p>
  
  <pre><code>Specific error: {#ErrorId#}
  Error description: {#Description#}
  Additional information:{#AdditionalInformation#}
  </code></pre>
  
  <p>And in the C# code:</p>
  
  <pre><code>Dictionary&lt;string, string&gt; tokensAndValues = new Dictionary&lt;string, string&gt;
  {
      {@"ErrorId", errorId},
      {@"Description", description},
      {@"AdditionalInformation", additionalInformation}
  };
  </code></pre>
  
  <p>I came across dotnetliquid and it appears quite powerful (possibly overkill for my needs?). I've got it working but I want to ask if I'm going about this in the correct fashion?</p>
  
  <p>It appears I'm forced to declare a class viz.</p>
  
  <pre><code>public class EmailTemplateInfo : Drop
  {
      public string ErrorId { get; set; }
      public string Description { get; set; }
      public string AdditionalInformation { get; set; }
  }
  </code></pre>
  
  <p>And then use that as follows:</p>
  
  <pre><code>Template.NamingConvention = new CSharpNamingConvention();
  Template template = Template.Parse(templateText);
  
  EmailTemplateInfo emailTemplateInfo = new EmailTemplateInfo
  {
      AdditionalInformation = additionalInformation,
      Description = description,                    
      ErrorId = errorId
  };
  
  string htmlText = template.Render(Hash.FromAnonymousObject(new {emailTemplateInfo = emailTemplateInfo }));
  </code></pre>
  
  <p>A few questions: </p>
  
  <ol>
  <li><p>Is this the correct way to do this? If it is then I'll propose doing an addition to the docs that demonstrates this functionality. </p></li>
  <li><p>Secondly in the template that I use do I need to qualify the placeholders with the name of the variable like this?</p>
  
  <pre><code>Specific error: {{emailTemplateInfo.ErrorId}}
  Error description: {{emailTemplateInfo.Description}}
  Additional information:{{emailTemplateInfo.AdditionalInformation}}
  </code></pre></li>
  <li><p>I can't see how the naming convention declaration [<code>Template.NamingConvention = new CSharpNamingConvention();</code>] ties in with the template variable declaration below it. Is there some sort of global caching going on?</p></li>
  </ol>