void Func without arguments

Your wording is confusing. You perhaps mean “a function without a return type and no parameters.” There is simply System.Action.

Action action = () => Console.WriteLine("hello world");
action();

From your comment:

But I need to fill in a <T> type in an Action and void is not a possibility (I will edit my question, I made a mistake).

This indicates a misunderstanding. The T in the Action delegate is an input. The void is the output. An Action delegate is inherently a delegate returning void. The T is the type of input it can act upon, the parameters you would then supply with arguments.

At any rate, as this answer and others show, you can have an Action delegate without any T, a delegate that takes no inputs.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)