title: ASP Net Core 3, set global variable from database and use in view, controllers
body: <p>First of all excuse me for my bad english ...</p>
  <p>I'm looking for a way to use a class in all my project. I explain my need to you. Because I don't know where to go.
  I'have a web project asp net core connected to sql server. Inside i have a public pages with different section (ex: payment, create, message, ads, register...), and i have a area admin (back office for me).</p>
  <p>I have a class :</p>
  <pre><code>public class Section
  {
     public bool RegistrationEnabled { get; set; }
     public bool PaymentEnabled { get; set; }
     public bool PublicationEnabled { get; set; }
     public bool MessageEnabled { get; set; }
  }
  </code></pre>
  <p>I want this class to allow me to make certain part of the site accessible or not in my views or in my controllers.
  Ex in view :</p>
  <pre><code>@if (Section.RegistrationEnabled)
  { 
     // Display form register..
  }
  </code></pre>
  <p>The data is saved in a table in sql server (with entity framework), and I must be able to modify it from my admin area. I would like it to be persistent without having to fetch it each time a page is called by a user.
  I have explored different solution:</p>
  <ul>
  <li>appSetting: but I can't edit from my admin interface I think?</li>
  <li>Resource file: But I don't think I can edit it directly?</li>
  <li>Singleton?</li>
  <li>Azure ?</li>
  </ul>
  <p>I'm out of ideas and I don't know where to go ...</p>