Owin.Loader.DefaultLoader.Matches C# (CSharp) Method

Matches() private static method

private static Matches ( MethodInfo methodInfo, Type returnType ) : bool
methodInfo System.Reflection.MethodInfo
returnType System.Type
return bool
        private static bool Matches(MethodInfo methodInfo, Type returnType, params Type[] parameterTypes)
        {
            if (returnType != null && methodInfo.ReturnType != returnType)
            {
                return false;
            }

            var parameters = methodInfo.GetParameters();
            if (parameters.Length != parameterTypes.Length)
            {
                return false;
            }

            return parameters.Zip(parameterTypes, (pi, t) => pi.ParameterType == t).All(b => b);
        }