private static string BuildHubExecutableMethodCacheKey(HubDescriptor hub, string method, IList<IJsonValue> parameters)
{
string normalizedParameterCountKeyPart;
if (parameters != null)
{
normalizedParameterCountKeyPart = parameters.Count.ToString(CultureInfo.InvariantCulture);
}
else
{
// NOTE: we normalize a null parameter array to be the same as an empty (i.e. Length == 0) parameter array
normalizedParameterCountKeyPart = "0";
}
// NOTE: we always normalize to all uppercase since method names are case insensitive and could theoretically come in diff. variations per call
string normalizedMethodName = method.ToUpperInvariant();
string methodKey = hub.Name + "::" + normalizedMethodName + "(" + normalizedParameterCountKeyPart + ")";
return methodKey;
}