This may sound like a bit of a dumb question but how do I make a Func<>
variable that doesn't return anything?
You can use Action<T>
for a delegate that takes a variable and returns void
.
But note that you can also just declare your own delegate types if you want to. Action<T>
, for example, is just
public delegate void Action<T>(T obj)
Will the Action<T> delegate work for you?
Action<T>
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