<p>I've written a simple SessionItem management class to handle all those pesky null checks and insert a default value if none exists.  Here is my GetItem method:</p>

<pre><code>public static T GetItem&lt;T&gt;(string key, Func&lt;T&gt; defaultValue)
{
    if (HttpContext.Current.Session[key] == null)
    {
        HttpContext.Current.Session[key] = defaultValue.Invoke();
    }
    return (T)HttpContext.Current.Session[key];
}
</code></pre>

<p>Now, how do I actually use this, passing in the Func&lt;T&gt; as an inline method parameter?</p>

Why don't you pass the default value directly? What use is the functor?
By the way,
```
defaultValue.Invoke()
```
is quite verbose. It's also possible to just write
```
defaultValue()
```
.