1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
protected delegate TResponse CallMethodWithGenericParamDelegate<TResponse, TParam>(TParam param) where TResponse : ResponseBase;
protected delegate TResponse CallMethodWithStringParamDelegate<TResponse>(string param) where TResponse : ResponseBase;
protected TResponse CallRetryByDelegate<TResponse>(Delegate delegateMethod, params object[] parameters) where TResponse : ResponseBase, new()
{
TResponse response = null;
int retry = 0;
Exception exception = null;
do
{
try
{
response = (TResponse)delegateMethod.DynamicInvoke(parameters);
retry = 0;
...... |