|
|
@@ -2,6 +2,7 @@
|
|
|
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
+using System.Threading;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
namespace System.Linq
|
|
|
@@ -29,19 +30,22 @@ namespace System.Linq
|
|
|
/// Gets the item associated with a 0-based index in this sequence.
|
|
|
/// </summary>
|
|
|
/// <param name="index">The 0-based index to access.</param>
|
|
|
+ /// <param name="cancellationToken">Token to observe for cancellation requests.</param>
|
|
|
/// <returns>The element if found, otherwise, the default value of <see cref="TElement"/>.</returns>
|
|
|
- Task<Maybe<TElement>> TryGetElementAsync(int index);
|
|
|
+ Task<Maybe<TElement>> TryGetElementAsync(int index, CancellationToken cancellationToken);
|
|
|
|
|
|
/// <summary>
|
|
|
/// Gets the first item in this sequence.
|
|
|
/// </summary>
|
|
|
+ /// <param name="cancellationToken">Token to observe for cancellation requests.</param>
|
|
|
/// <returns>The element if found, otherwise, the default value of <see cref="TElement"/>.</returns>
|
|
|
- Task<Maybe<TElement>> TryGetFirstAsync();
|
|
|
+ Task<Maybe<TElement>> TryGetFirstAsync(CancellationToken cancellationToken);
|
|
|
|
|
|
/// <summary>
|
|
|
/// Gets the last item in this sequence.
|
|
|
/// </summary>
|
|
|
+ /// <param name="cancellationToken">Token to observe for cancellation requests.</param>
|
|
|
/// <returns>The element if found, otherwise, the default value of <see cref="TElement"/>.</returns>
|
|
|
- Task<Maybe<TElement>> TryGetLastAsync();
|
|
|
+ Task<Maybe<TElement>> TryGetLastAsync(CancellationToken cancellationToken);
|
|
|
}
|
|
|
}
|