I want to do something using a lambda expression and it doesn't use any parameters, I know I can use the form () => foo() but I can't figure out what to do at the function prototype where the lambda is passed as a parameter
Here's the code
class c {
public static void Main() {
Bar(() => Console.WriteLine("Hey"));
}
public static void Bar(what_goes_here foo) {
foo(); //Should print "Hey"
}
}
Action:
Encapsulates a method that has no parameters and does not return a value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With