26 lines
683 B
C#
26 lines
683 B
C#
using JiShe.CollectBus.Protocol.Contracts.Interfaces;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace JiShe.CollectBus.Protocol.Contracts
|
|
{
|
|
|
|
public class AnalysisStrategyContext<TInput, TResult>
|
|
{
|
|
private readonly IAnalysisStrategy<TInput, TResult> _analysisStrategy;
|
|
|
|
public AnalysisStrategyContext(IAnalysisStrategy<TInput, TResult> analysisStrategy)
|
|
{
|
|
_analysisStrategy = analysisStrategy;
|
|
}
|
|
|
|
public Task<TResult> ExecuteAnalysisStrategy(TInput input)
|
|
{
|
|
return _analysisStrategy.ExecuteAsync(input);
|
|
}
|
|
}
|
|
}
|