How exactly would I go about doing the following in C#?

public class Test {
    public static void main(String[] args) {
        Test(new TestInterface() {
            @Override
            public void SomeMethod() {
                //create instance of the interface within parameters of a method.
            }       
        });
    }

    public static void Test(TestInterface _interface) {

    }
}

public interface TestInterface {
    public void SomeMethod();
}

I'm not entirely sure how to explain this in words, so I decided to use this example.

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.