title: Storing classes in Application State (ASP.NET)
body: <p>Let's say I wish to store an instance of the following in Application State, to be accessed very often.</p>
  
  <pre><code>public class Example {
    public string A;
    public string B;
    public bool C;
    public int D;
    // ...
  }
  </code></pre>
  
  <p>I can't decide whether to store the whole class together as <code>Application["Example"]</code>, or to store its properties individually as <code>Application["ExampleA"]</code> etc.</p>
  
  <p>My thinking is that <code>((Example)Application["Example"]).A</code> might have to copy the whole class into memory just to access one property - is that right? Or am I mistaken?</p>