Interface IStrategy<TContext, TResult>
- Namespace
- WitShells.DesignPatterns.Core
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
TContextInput type passed to the algorithm.
TResultOutput type produced by the algorithm.
Methods
Execute(TContext)
Executes the algorithm using the supplied context.
TResult Execute(TContext context)
Parameters
contextTContextThe input data for the algorithm.
Returns
- TResult
The result produced by the algorithm.