System.Linq.QueryableTransformer.TypeMatch C# (CSharp) Метод

TypeMatch() статический приватный Метод

static private TypeMatch ( Type candidate, Type type ) : bool
candidate System.Type
type System.Type
Результат bool
		static bool TypeMatch (Type candidate, Type type)
		{
			if (candidate == type)
				return true;

			return candidate == GetComparableType (type);
		}

Usage Example

 private static bool MethodMatch(MethodInfo candidate, MethodInfo method)
 {
     if (candidate.Name != method.Name)
     {
         return(false);
     }
     if (!QueryableTransformer.HasExtensionAttribute(candidate))
     {
         return(false);
     }
     Type[] parameterTypes = method.GetParameterTypes();
     if (parameterTypes.Length != candidate.GetParameters().Length)
     {
         return(false);
     }
     if (method.IsGenericMethod)
     {
         if (!candidate.IsGenericMethod)
         {
             return(false);
         }
         if (candidate.GetGenericArguments().Length != method.GetGenericArguments().Length)
         {
             return(false);
         }
         candidate = candidate.MakeGenericMethodFrom(method);
     }
     if (!QueryableTransformer.TypeMatch(candidate.ReturnType, method.ReturnType))
     {
         return(false);
     }
     Type[] parameterTypes2 = candidate.GetParameterTypes();
     if (parameterTypes2[0] != QueryableTransformer.GetComparableType(parameterTypes[0]))
     {
         return(false);
     }
     for (int i = 1; i < parameterTypes2.Length; i++)
     {
         if (!QueryableTransformer.TypeMatch(parameterTypes2[i], parameterTypes[i]))
         {
             return(false);
         }
     }
     return(true);
 }