I want to add multiple parameter in a Task containing Action. I reviewed the existing stack-overflow question Create a Task with an Action
Kindly assist me
Just pass the parameters like this.
Action action = async (msg, count) => await LoadAsync(msg, count);
Task task = new Task(() => action("", 0)); // pass parameters you want
If you want to also get return value
Func> func = LoadAsync;
Task task = func("", 0); // pass parameters you want
var result = await task; // later in async method