title: Method that expands into <li>...</li> expression
body: <p>Let's suppose I have the following in a 'cshtml' file:</p>
  
  <pre><code>&lt;li class="nav-item"&gt;
      &lt;a class="nav-link text-white" asp-area="" asp-controller="Home" asp-action="Index"&gt;Home&lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li class="nav-item"&gt;
      &lt;a class="nav-link text-white" asp-area="" asp-controller="Home" asp-action="Privacy"&gt;Privacy&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>I'd like to setup a method <code>Link</code> so that I can do the following instead of the above:</p>
  
  <pre><code>@Link("nav-link text-white", "Home", "Index", "Home")
  @Link("nav-link text-white", "Home", "Privacy", "Privacy")
  </code></pre>
  
  <p>Here's one approach that I tried:</p>
  
  <pre><code>@{
      void Link(string a_class, string controller, string action, string text)
      {
          &lt;li class="nav-item"&gt;
              &lt;a class="@a_class" asp-area="" asp-controller="@controller" asp-action="@action"&gt;@text&lt;/a&gt;
          &lt;/li&gt;
      }
  
  }
  </code></pre>
  
  <p>However, this leads the following error message:</p>
  
  <p><a href="https://i.stack.imgur.com/W5lz9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W5lz9.png" alt="enter image description here"></a></p>
  
  <p>What's a good way to implement the above <code>Link</code> method?</p>