title: Optional attributes in tag helpers
body: <p>I have a tag helper along the lines of the following:</p>
  
  <pre><code>[HtmlTargetElement("foo", Attributes = "bar")]
  public class FooTagHelper : TagHelper
  
  [HtmlAttributeName("bar")]
  public bool Bar { get; set; }
  </code></pre>
  
  <p>When I add the following to a view, the tag helper processes the target as expected:</p>
  
  <pre><code>&lt;foo bar="true"&gt;&lt;/foo&gt;
  </code></pre>
  
  <p>However, what I would like to do is make <code>bar</code> optional e.g. <code>&lt;foo&gt;&lt;/foo&gt;</code> If it has been left off, I would like it to default to <code>false</code></p>
  
  <p>Is this possible? This source code comment for the <code>HtmlTargetElementAttribute.Attributes</code> property seems to indicate not:</p>
  
  <blockquote>
    <p>// Summary:<br>
    A comma-separated System.String of attribute names the HTML element must contain<br>
    for the Microsoft.AspNet.Razor.TagHelpers.ITagHelper to run. * at the end of
    an attribute name acts as a prefix match.</p>
  </blockquote>