title: Can I create a stateless static class in MVC back-end
body: <p>I have an MVC application that contains a static class providing a boolean value to the rest of the program. My issue is that I want the boolean to reset with each call to the back-end. I want it to be &quot;stateless&quot;, getting initialized to false for each and every back-end call. I'll then set it to true as needed. For instance, consider the following where from the <code>Index</code> view we load the <code>About</code> view and then afterwards load the <code>Contact</code> view ...</p>
  <pre><code>public static class BooleanProvider
  {
      public static bool theBool = false;
  }
  
  public class HomeController : Controller
  {
      public ActionResult Index()
      {
          return View();
      }
  
      public ActionResult About()
      {
          ViewBag.Message = &quot;Your application description page.&quot;;
          BooleanProvider.theBool = true;
  
          return View();
      }
  
      public ActionResult Contact()
      {
          ViewBag.Message = &quot;Your contact page.&quot;;
          //I want BooleanProvider.theBool to be false here, since it's a different call, even though we set it to true in the About() method
  
          return View();
      }
  }
  </code></pre>
  <p>When I check <code>BooleanProvider.theBool</code> at the commented line, it's set to true. Is there a way to &quot;re-initialize&quot; the boolean with every call? I'd rather not make the class instantiable and have to new it up with each controller call, but maybe there is no other way?</p>
  <p>Thank you in advance!</p>