I created a task like the following code
Task task = new(async () =>
{
// without await Task Delay dont work
await Task.Delay(TimeSpan.FromSeconds(5));
Console.WriteLine("Task is down");
});
task.Start();
var awaiter = task.GetAwaiter();
awaiter.OnCompleted(() =>
{
Console.WriteLine("Task is Completed");
});
Why the task completed first is printed and then the task is down The task is complete and will be printed if my operation is not finished yet