Is there a way I can write the following without typing out the whole signature again?
//desired base signature
public delegate string BaseDelegate<TProfile, TResult>(string requestorID, DateTime sentDate, string serviceID,
string source, TProfile profile, out DateTime recieved, out DateTime sent, out string psatSystemID, out TResult[] result);
//ugly version of child
public delegate string CurriedDelegate<T>(string requestorId, DateTime sentDate, string serviceId, string source,
T profile, out DateTime recieved, out DateTime sent, out string psatSystemID, out T[] result);
//syntax sugar,doesn't compile
public BaseDelegate<T,T> CurriedDelegate<T>; //TProfile is same type as TResult
No, there’s no way of doing that, although you could create a
CurriedDelegate<T>from aBaseDelegate<TProfile, TResult>if the two type parameters were the same.It seems to me like a better solution would be to encapsulate the various parameters in a separate type anyway. That really is a horribly long signature to start with, and presumably the parameters are related to each other.
(I’d also try to avoid using so many
outparameters – perhaps you’ve actually got two types to encapsulate here, one for input and one for output?)