I\'m trying to run a function in a task but I\'m doing something wrong. Heres an example:
var t = Task.Factory.StartNew(() => GenerateResult(2)
You are printing the task object that you created. For result, see .Result property:
.Result
Console.WriteLine(t.Result);