I might be having a brainfart here, and I probably am, however it's somewhat hard to word my problem, so I'm having some issues finding help.
Essentially, in Java, you can do something like this:
// create some generic class
public class Test {
public void random() {}
}
// other class
public class Test2 {
public Test2() {
someFunction(new Test() {
public void random() {
System.out.println("howdy");
}
});
}
private someFunction(Test t) {
t.random();
}
}
I'm looking to convert this idea (modifying the contents of a class while passing it as a variable) into C#. I understand it can be done with lambda expressions, however I cannot for the life of me seem to figure it out. Any help is appreciated.