title: How do you iterate through a list in c# using mustache and get each value in a placeholder
body: <p>I am using mustache# for .Net and to help me get values into a html template for an email application.  I am able to get mustache placeholders to store single values but having issues iterating through a a list and saving the values in a placeholder.</p>
  
  <p>My example list in the code I provide below is a simple string List with 2 elements. When the email sends and the html template is attached All I am getting for this is System.Collections.Generic.List'1[System.String] twice.
  I understand why its showing up twice because of there being 2 elements in the list.  I just don't know how to have it show each value instead. </p>
  
  <pre><code>List&lt;string&gt; namelist = new List&lt;string&gt;();
  namelist.Add("Val");
  namelist.Add("Jeff");
  
  const string names = "{{#each name}} &lt;h2&gt; Hello, {{name}}&lt;/h2&gt; {{/each}}";
  
  HtmlFormatCompiler compilers = new HtmlFormatCompiler();
  
  Generator generator = compilers.Compile(names);
  
  string result = generator.Render(new
  {
       name = namelist
  
  });
  
  
  string template = System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath
  ("~/Views/Shared/_HpNotificationEmailTemplate.cshtml"));
  
  string emailBody = string.Format(template,result);
  
  </code></pre>
  
  <p>I am expecting it to show the values  Val and Jeff but I am just getting System.Collections.Generic.List'1[System.String] twice.</p>