title: Can ASP.NET Core save objects in memory while running?
body: <p>Is it possible to save objects in memory while ASP.NET Core is running? How can <code>EntityList</code> below be accessed from a transient object like a SignalR Hub?</p>
  
  <p><strong>Program.cs</strong></p>
  
  <pre><code>namespace ASPNETCoreApp
  {
      public class Program
      {
  
          public List&lt;Entity&gt; EntityList = new List&lt;Entity&gt;();
  
          public static void Main(string[] args)
          {
              CreateWebHostBuilder(args).Build().Run();
              Entity Entity1 = new Entity();
              EntityList.Add(Entity1);
          }
  
          public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
              .UseStartup&lt;Startup&gt;();
      }
  }
  </code></pre>