View Source
  Class ModelType
  
  Represents the CLR type of a model.
 
  
  
    Inheritance
      System.Object
      
   
  
  Assembly: Umbraco.Core.dll
  Syntax
  
    public class ModelType : Type
   
  Examples
  ModelType.For("alias")
typeof (IEnumerable{}).MakeGenericType(ModelType.For("alias"))
Model.For("alias").MakeArrayType()
  Properties
  
  
    View Source
  
  Assembly
  
  
  Declaration
  
    public override Assembly Assembly { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Assembly | 
         | 
      
    
  
  
    View Source
  
  AssemblyQualifiedName
  
  
  Declaration
  
    public override string AssemblyQualifiedName { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
    View Source
  
  BaseType
  
  
  Declaration
  
    public override Type BaseType { get; }
   
  Property Value
  
  
    View Source
  
  ContentTypeAlias
  Gets the content type alias.
 
  
  Declaration
  
    public string ContentTypeAlias { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
    View Source
  
  FullName
  
  
  Declaration
  
    public override string FullName { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
    View Source
  
  GUID
  
  
  Declaration
  
    public override Guid GUID { get; }
   
  Property Value
  
  
    View Source
  
  Module
  
  
  Declaration
  
    public override Module Module { get; }
   
  Property Value
  
  
    View Source
  
  Name
  
  
  Declaration
  
    public override string Name { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
    View Source
  
  Namespace
  
  
  Declaration
  
    public override string Namespace { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
    View Source
  
  UnderlyingSystemType
  
  
  Declaration
  
    public override Type UnderlyingSystemType { get; }
   
  Property Value
  
  Methods
  
  
    View Source
  
  Equals(Type, Type)
  Gets a value indicating whether two  instances are equal.
 
  
  Declaration
  
    public static bool Equals(Type t1, Type t2)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Type | 
        t1 | 
        The first instance. 
 | 
      
      
        | Type | 
        t2 | 
        The second instance. 
 | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
        A value indicating whether the two instances are equal. 
 | 
      
    
  
  
  
  
    View Source
  
  For(String)
  Gets the model type for a published element type.
 
  
  Declaration
  
    public static ModelType For(string alias)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        alias | 
        The published element type alias. 
 | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | ModelType | 
        The model type for the published element type. 
 | 
      
    
  
  
    View Source
  
  GetAttributeFlagsImpl()
  
  
  Declaration
  
    protected override TypeAttributes GetAttributeFlagsImpl()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | TypeAttributes | 
         | 
      
    
  
  
    View Source
  
  GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
  
  
  Declaration
  
    protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
      
        | Binder | 
        binder | 
         | 
      
      
        | CallingConventions | 
        callConvention | 
         | 
      
      
        | Type[] | 
        types | 
         | 
      
      
        | ParameterModifier[] | 
        modifiers | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | ConstructorInfo | 
         | 
      
    
  
  
    View Source
  
  GetConstructors(BindingFlags)
  
  
  Declaration
  
    public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | ConstructorInfo[] | 
         | 
      
    
  
  
    View Source
  
  GetCustomAttributes(Boolean)
  
  
  Declaration
  
    public override object[] GetCustomAttributes(bool inherit)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Boolean | 
        inherit | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Object[] | 
         | 
      
    
  
  
    View Source
  
  GetCustomAttributes(Type, Boolean)
  
  
  Declaration
  
    public override object[] GetCustomAttributes(Type attributeType, bool inherit)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Type | 
        attributeType | 
         | 
      
      
        | System.Boolean | 
        inherit | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Object[] | 
         | 
      
    
  
  
    View Source
  
  GetElementType()
  
  
  Declaration
  
    public override Type GetElementType()
   
  Returns
  
  
    View Source
  
  GetEvent(String, BindingFlags)
  
  
  Declaration
  
    public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        name | 
         | 
      
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | EventInfo | 
         | 
      
    
  
  
    View Source
  
  GetEvents(BindingFlags)
  
  
  Declaration
  
    public override EventInfo[] GetEvents(BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | EventInfo[] | 
         | 
      
    
  
  
    View Source
  
  GetField(String, BindingFlags)
  
  
  Declaration
  
    public override FieldInfo GetField(string name, BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        name | 
         | 
      
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | FieldInfo | 
         | 
      
    
  
  
    View Source
  
  GetFields(BindingFlags)
  
  
  Declaration
  
    public override FieldInfo[] GetFields(BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | FieldInfo[] | 
         | 
      
    
  
  
    View Source
  
  GetInterface(String, Boolean)
  
  
  Declaration
  
    public override Type GetInterface(string name, bool ignoreCase)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        name | 
         | 
      
      
        | System.Boolean | 
        ignoreCase | 
         | 
      
    
  
  Returns
  
  
    View Source
  
  GetInterfaces()
  
  
  Declaration
  
    public override Type[] GetInterfaces()
   
  Returns
  
  
    View Source
  
  GetMembers(BindingFlags)
  
  
  Declaration
  
    public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | MemberInfo[] | 
         | 
      
    
  
  
    View Source
  
  GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
  
  
  Declaration
  
    protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        name | 
         | 
      
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
      
        | Binder | 
        binder | 
         | 
      
      
        | CallingConventions | 
        callConvention | 
         | 
      
      
        | Type[] | 
        types | 
         | 
      
      
        | ParameterModifier[] | 
        modifiers | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | MethodInfo | 
         | 
      
    
  
  
    View Source
  
  GetMethods(BindingFlags)
  
  
  Declaration
  
    public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | MethodInfo[] | 
         | 
      
    
  
  
    View Source
  
  GetNestedType(String, BindingFlags)
  
  
  Declaration
  
    public override Type GetNestedType(string name, BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        name | 
         | 
      
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
  
    View Source
  
  GetNestedTypes(BindingFlags)
  
  
  Declaration
  
    public override Type[] GetNestedTypes(BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
  
    View Source
  
  GetProperties(BindingFlags)
  
  
  Declaration
  
    public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | PropertyInfo[] | 
         | 
      
    
  
  
    View Source
  
  GetPropertyImpl(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])
  
  
  Declaration
  
    protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        name | 
         | 
      
      
        | BindingFlags | 
        bindingAttr | 
         | 
      
      
        | Binder | 
        binder | 
         | 
      
      
        | Type | 
        returnType | 
         | 
      
      
        | Type[] | 
        types | 
         | 
      
      
        | ParameterModifier[] | 
        modifiers | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | PropertyInfo | 
         | 
      
    
  
  
    View Source
  
  HasElementTypeImpl()
  
  
  Declaration
  
    protected override bool HasElementTypeImpl()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])
  
  
  Declaration
  
    public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        name | 
         | 
      
      
        | BindingFlags | 
        invokeAttr | 
         | 
      
      
        | Binder | 
        binder | 
         | 
      
      
        | System.Object | 
        target | 
         | 
      
      
        | System.Object[] | 
        args | 
         | 
      
      
        | ParameterModifier[] | 
        modifiers | 
         | 
      
      
        | CultureInfo | 
        culture | 
         | 
      
      
        | System.String[] | 
        namedParameters | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Object | 
         | 
      
    
  
  
    View Source
  
  IsArrayImpl()
  
  
  Declaration
  
    protected override bool IsArrayImpl()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  IsByRefImpl()
  
  
  Declaration
  
    protected override bool IsByRefImpl()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  IsCOMObjectImpl()
  
  
  Declaration
  
    protected override bool IsCOMObjectImpl()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  IsDefined(Type, Boolean)
  
  
  Declaration
  
    public override bool IsDefined(Type attributeType, bool inherit)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Type | 
        attributeType | 
         | 
      
      
        | System.Boolean | 
        inherit | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  IsPointerImpl()
  
  
  Declaration
  
    protected override bool IsPointerImpl()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  IsPrimitiveImpl()
  
  
  Declaration
  
    protected override bool IsPrimitiveImpl()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    View Source
  
  MakeArrayType()
  
  
  Declaration
  
    public override Type MakeArrayType()
   
  Returns
  
  
    View Source
  
  Map(Type, Dictionary<String, Type>)
  Gets the actual CLR type by replacing model types, if any.
 
  
  Declaration
  
    public static Type Map(Type type, Dictionary<string, Type> modelTypes)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Type | 
        type | 
        The type. 
 | 
      
      
        | Umbraco.Cms.Core.Dictionary<System.String, Type> | 
        modelTypes | 
        The model types map. 
 | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Type | 
        The actual CLR type. 
 | 
      
    
  
  
    View Source
  
  Map(Type, Dictionary<String, Type>, Boolean)
  
  
  Declaration
  
    public static Type Map(Type type, Dictionary<string, Type> modelTypes, bool dictionaryIsInvariant)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Type | 
        type | 
         | 
      
      
        | Umbraco.Cms.Core.Dictionary<System.String, Type> | 
        modelTypes | 
         | 
      
      
        | System.Boolean | 
        dictionaryIsInvariant | 
         | 
      
    
  
  Returns
  
  
    View Source
  
  MapToName(Type, Dictionary<String, String>)
  Gets the actual CLR type name by replacing model types, if any.
 
  
  Declaration
  
    public static string MapToName(Type type, Dictionary<string, string> map)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Type | 
        type | 
        The type. 
 | 
      
      
        | Umbraco.Cms.Core.Dictionary<System.String, System.String> | 
        map | 
        The model types map. 
 | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
        The actual CLR type name. 
 | 
      
    
  
  
    View Source
  
  ToString()
  
  
  Declaration
  
    public override string ToString()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         |