public bool TryBind(out IEnumerable <MethodInfo> candidates) { Type[] parameterTypes = _methodInfo.GetParameters() .Select(parameter => parameter.ParameterType) .ToArray(); List <MethodInfo> result = new List <MethodInfo>(); candidates = result; if (parameterTypes.Length != _runtimeParameterTypes.Length) { return(false); } ArgumentMapper mapper = new ArgumentMapper(_methodInfo); for (int i = 0; i < parameterTypes.Length; i++) { Type parameterType = parameterTypes[i]; Type runtimeParameterType = _runtimeParameterTypes[i]; if (!mapper.TryBind(parameterType, runtimeParameterType)) { return(false); } } foreach (Type[] candidate in mapper.GetGenericArgumentsCandidates()) { MethodInfo bindedMethod; if (_methodInfo.TryMakeGenericMethodMethod(candidate, out bindedMethod)) { result.Add(bindedMethod); } } return(result.Count > 0); }