This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-nitride-cil/src/MfGames.Nitride/NitrideOperationExtensions.cs
D. Moonfire 2892ec3445
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
feat!: added cancellation token support to pipelines and operations
2023-01-17 19:24:09 -06:00

29 lines
915 B
C#

using System.Collections.Generic;
using System.Threading;
using MfGames.Gallium;
namespace MfGames.Nitride;
/// <summary>
/// Extension methods to run a Nitride operation inline with code.
/// </summary>
public static class NitrideOperationExtensions
{
/// <summary>
/// Runs the given configured operation against the input and returns
/// the results.
/// </summary>
/// <param name="input">The entities to perform the operation against.</param>
/// <param name="operation">The operation to run.</param>
/// <param name="cancellationToken">The cancellation token of the request.</param>
/// <returns>The results of the operation.</returns>
public static IEnumerable<Entity> Run(
this IEnumerable<Entity> input,
IOperation operation,
CancellationToken cancellationToken = default)
{
return operation.Run(input, cancellationToken);
}
}