Castle.ActiveRecord.Framework.Internal.AbstractDepthFirstVisitor.GuessType C# (CSharp) Méthode

GuessType() public static méthode

Guesses the type of the other end.
public static GuessType ( Type type, Type propertyType ) : Type
type System.Type The type.
propertyType System.Type Type of the property.
Résultat System.Type
		public static Type GuessType(Type type, Type propertyType)
		{
			Type otherend = type;

			if (otherend == null)
			{
				// naive guessing of type if not specified
				if (propertyType.IsGenericType)
				{
					Type[] arguments = propertyType.GetGenericArguments();
					
					if (arguments.Length == 1)
					{
						otherend = arguments[0];
					}
				}
			}
			return otherend;
		}
	}