title: Dynamic Navbar links in the shared layout MVC/Razor
body: <p>I would like links on the navigation bar to appear or disappear depending upon the data in the database. All the nav bar links are in _Layout.cshtml which is being used by all pages.</p>
  
  <pre><code>&lt;ul&gt;
   @if (User.Identity.IsAuthenticated)
    {
     &lt;li class="nav-item dropdown"&gt;
       &lt;a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"&gt;Bookings&lt;/a&gt;
       &lt;ul class="dropdown-menu"&gt;                             
       &lt;li&gt;@Html.ActionLink("All Bookings", "GetAllBookings", "Booking")&lt;/li&gt;
       &lt;li&gt;@Html.ActionLink("Member's Dashboard", "GetBookingsByStatus", "Booking")&lt;/li&gt;
       &lt;/ul&gt;
     &lt;/li&gt;                     
  &lt;/ul&gt;
  </code></pre>
  
  <p>I would like member's dashboard to only appear if they are a member and have certain attributes in their profile. What is the best way to dynamically changing the nav bar links depending upon the data in database?</p>