/// <summary>
 /// Gets the list of the tasks using the criteria specified into the query
 /// </summary>
 /// <param name="query">Query to use for filtering</param>
 /// <param name="token">The cancellation token, if any</param>
 /// <returns></returns>
 public abstract IAsyncEnumerable <TransformationProcessTaskStatus> GetTasksStatusAsync(TasksStatusQuery query, CancellationToken token = default);
        /// <summary>
        /// Gets the list of the tasks using the criteria specified into the query
        /// </summary>
        /// <param name="query">Query to use for filtering</param>
        /// <param name="token">Cancellation token to use, if any</param>
        /// <returns>The process task status</returns>
        public override IAsyncEnumerable <TransformationProcessTaskStatus> GetTasksStatusAsync(TasksStatusQuery query, CancellationToken token = default)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            return(TransformationStateManager.GetProcessTasksStatus(Id, query, token));
        }
        /// <summary>
        /// Returns the list of tasks statuses using the query specified
        /// </summary>
        /// <param name="processId">The ID of the transformation process to query</param>
        /// <param name="query">The query to retrieve the tasks statuses related to the process</param>
        /// <param name="token">The cancellation token, if any</param>
        /// <returns>An asynchronous enumerable of tasks statuses</returns>
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
        public async IAsyncEnumerable<TransformationProcessTaskStatus> GetProcessTasksStatus(Guid processId, TasksStatusQuery query, [EnumeratorCancellation] CancellationToken token = default)
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
        {
            if (query == null) throw new ArgumentNullException(nameof(query));

            foreach (var pair in taskStatuses)
            {
                if (!query.State.HasValue || pair.Value.State == query.State.Value)
                {
                    yield return pair.Value;
                }
            }
        }