mirror of
https://github.com/StockSharp/StockSharp.git
synced 2026-12-05 09:02:09 +00:00
25 lines
830 B
C#
25 lines
830 B
C#
namespace StockSharp.Algo.Export;
|
|
|
|
using System.Collections;
|
|
|
|
/// <summary>
|
|
/// Extensions for <see cref="BaseExporter"/>.
|
|
/// </summary>
|
|
public static class BaseExporterExtensions
|
|
{
|
|
/// <summary>
|
|
/// To export values.
|
|
/// </summary>
|
|
/// <param name="exporter"><see cref="BaseExporter"/></param>
|
|
/// <param name="values">Value.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>Count and last time.</returns>
|
|
[Obsolete("Use Export(IAsyncEnumerable<object>, CancellationToken) method.")]
|
|
public static Task<(int, DateTime?)> Export(this BaseExporter exporter, IEnumerable values, CancellationToken cancellationToken)
|
|
{
|
|
if (values == null)
|
|
throw new ArgumentNullException(nameof(values));
|
|
|
|
return exporter.Export(values.Cast<object>().ToAsyncEnumerable(), cancellationToken);
|
|
}
|
|
} |