title: Use static global variable class in ASP.NET MVC web application
body: <p>I am creating an ASP.NET MVC web application. It has service classes to execute business logic and it access data through Entity Framework. </p>
  
  <p>I want to change some business logic based on application variable. These variables are global variables and load from app config and don't change after the initial loading. </p>
  
  <pre><code>public class BroadcastService : IBroadcastService
  {
      private static readonly ILog Logger = LogProvider.GetCurrentLogger();
      private readonly IUnitOfWork _worker;
      private readonly IGlobalService _globalService;
  
      public BroadcastService(IUnitOfWork worker, IGlobalService globalService)
      {
        _worker = worker;
        _globalService = globalService;
      }
  
      public IEnumerable&lt;ListItemModel&gt; GetBroadcastGroups()
      {
         if(Global.EnableMultiTenant)
         {
            //load data for all tenants
         }
         else
         {
             //load data for current tenant only
         }
  
         return broadcastGroups ?? new List&lt;ListItemModel&gt;();
      }
  
      ...
  }
  
  public static class Global
  {
      public static bool EnableMultiTenant{get;set;}
  }
  </code></pre>
  
  <p>For example, <code>EnableMultiTenant</code> will hold application is running in multi-tenant mode or not.</p>
  
  <p>My concerns are:</p>
  
  <ol>
  <li><p>Is it ok to use a static global variable class to holds those values?</p></li>
  <li><p>This application is hosting on Azure app service with load balancing. Is there any effect when running multi-instance and when app pool restarts? </p></li>
  </ol>