I am wondering if there is some inline short way of creating a class implementing a interface. Just like there are the anonymous methods but with implementing interfaces.
The problem is:
interface iSomeInterface
{
void DoIt();
}
public void myMethod(iSomeInterface param)
{
...
}
And I would like to use it like this:
object.myMethod(new { override DoIt() { Console.WriteLine("yay"); } } : iSomeInterface);
Any ideas?
Sorry in case its a duplicate.