title: Serialize Composed Func?
body: <p>This works fine:</p>
  
  <pre><code>    Func&lt;string, string&gt; func1 = s =&gt; s + "func";
      ViewState["function"] = func1;
  </code></pre>
  
  <p>However, this does not:</p>
  
  <pre><code>    Func&lt;string, string&gt; func1 = s =&gt; s + "func";
      Func&lt;string, string&gt; func2 = s =&gt; func1(s);
  
      ViewState["function"] = func2;
  </code></pre>
  
  <p>It throws a runtime serialization exception: <code>Type 'MyProjectName._Default+&lt;&gt;c__DisplayClass3' in Assembly 'MyProjectName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.</code></p>
  
  <p>Now, I can work around this this time, but I'd like to understand why this is happening so that if, in the future, I have no choice but to compose functions before serialization, I'll have a solution.</p>