29 lines
915 B
C#
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);
|
|
}
|
|
}
|