I figured it out.
I wrote a custom Attribute Filter that does this. Then in the code I have the following:
tokenSource = new CancellationTokenSource();
CancellationToken ct = tokenSource.Token;
var taskRepository = UnityContainerSetup.Container.Resolve<ITaskRepository>();
taskRepository.GetTasksStatusAsync(siteId, tasksItem, ct); // ct is my cancellation token that I set to true => to cancel