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

29 lines
915 B
C#
Raw Normal View History

2021-09-07 05:15:45 +00:00
using System.Collections.Generic;
using System.Threading;
2022-09-06 05:53:22 +00:00
using MfGames.Gallium;
2021-09-07 05:15:45 +00:00
2022-09-06 05:53:22 +00:00
namespace MfGames.Nitride;
/// <summary>
/// Extension methods to run a Nitride operation inline with code.
/// </summary>
public static class NitrideOperationExtensions
2021-09-07 05:15:45 +00:00
{
/// <summary>
/// Runs the given configured operation against the input and returns
/// the results.
2021-09-07 05:15:45 +00:00
/// </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>
2022-07-09 04:52:10 +00:00
public static IEnumerable<Entity> Run(
this IEnumerable<Entity> input,
IOperation operation,
CancellationToken cancellationToken = default)
2021-09-07 05:15:45 +00:00
{
return operation.Run(input, cancellationToken);
2021-09-07 05:15:45 +00:00
}
}