Table of Contents

Interface IStrategy<TContext, TResult>

Defines the contract for the Strategy pattern. Each strategy encapsulates one interchangeable algorithm that transforms a TContext value into a TResult value.

public interface IStrategy<TContext, TResult>

Type Parameters

TContext

Input type passed to the algorithm.

TResult

Output type produced by the algorithm.

Methods

Execute(TContext)

Executes the algorithm using the supplied context.

TResult Execute(TContext context)

Parameters

context TContext

The input data for the algorithm.

Returns

TResult

The result produced by the algorithm.