This may sound like a bit of a dumb question but how do I make a Func<>
variable that doesn't return anything?
views:
116answers:
3
+8
A:
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)
Gabe Moothart
2009-06-10 05:32:24
I don't know but is it necesary to usea delegate will the purpose not solved by only making the return type as void
Meetu Choudhary
2009-06-10 05:37:04
You can't specify void (or Void) as a type argument.
Jon Skeet
2009-06-10 05:41:16
but the question is about return type not for the agruments
Meetu Choudhary
2009-06-10 05:49:47