{
Task myTask = Task.Run(() => method(), cancelTokenSource.Token);
cancelTokenSource.cancel();
}
void method()
{
//Without specify any code like
cancelTokenSource.Token.ThrowIfCancellationRequested();
}
is there any alternate way to cancel the running task?