Overriding virtual methods when instantiating a class
<p>I have a class with some virtual functions, let's pretend this is one of them:</p>

<pre><code>public class AClassWhatever
{
    protected virtual string DoAThingToAString(string inputString)
    {
        return inputString + "blah";
    } 
}
</code></pre>

<p>I want to instantiate this class while overriding "DoAThingToAString" inline, much like I can declare properties inline in a declaration, as follows:</p>

<pre><code>...

AClassWhatever instance = new AClassWhatever
{
    DoAThingToAString = new function(string inputString)
    {
        return inputString + inputString + " fill my eyes."
    }
}

...
</code></pre>

<p>And now for "instance", DoAThingToAString is overridden with that definition. I need to be able to define the default behavior in the class definition and only override it as needed, differently different times, and I don't want to proliferate a bunch of subclasses to do this.</p>

<p>I know I need to use delegates or something similar, but I've been out of the syntax game for way too long and google was giving me too much irrelevant info.</p>
