View Source
Class ModelType
Represents the CLR type of a model.
Inheritance
object
MemberInfo
Type
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
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
View Source
FullName
Declaration
public override string FullName { get; }
Property Value
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
View Source
Namespace
Declaration
public override string Namespace { get; }
Property Value
View Source
UnderlyingSystemType
Declaration
public override Type UnderlyingSystemType { get; }
Property Value
Methods
View Source
Equals(Type, Type)
Gets a value indicating whether two System.Type 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 |
| bool |
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 |
| 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(bool)
Declaration
public override object[] GetCustomAttributes(bool inherit)
Parameters
| Type |
Name |
Description |
| bool |
inherit |
|
Returns
| Type |
Description |
| object[] |
|
View Source
GetCustomAttributes(Type, bool)
Declaration
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
| Type |
Name |
Description |
| Type |
attributeType |
|
| bool |
inherit |
|
Returns
| Type |
Description |
| 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 |
| 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 |
| 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, bool)
Declaration
public override Type? GetInterface(string name, bool ignoreCase)
Parameters
| Type |
Name |
Description |
| string |
name |
|
| bool |
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 |
| 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 |
| 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 |
| 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
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 |
| string |
name |
|
| BindingFlags |
invokeAttr |
|
| Binder |
binder |
|
| object |
target |
|
| object[] |
args |
|
| ParameterModifier[] |
modifiers |
|
| CultureInfo |
culture |
|
| string[] |
namedParameters |
|
Returns
View Source
IsArrayImpl()
Declaration
protected override bool IsArrayImpl()
Returns
View Source
IsByRefImpl()
Declaration
protected override bool IsByRefImpl()
Returns
View Source
IsCOMObjectImpl()
Declaration
protected override bool IsCOMObjectImpl()
Returns
View Source
IsDefined(Type, bool)
Declaration
public override bool IsDefined(Type attributeType, bool inherit)
Parameters
| Type |
Name |
Description |
| Type |
attributeType |
|
| bool |
inherit |
|
Returns
View Source
IsPointerImpl()
Declaration
protected override bool IsPointerImpl()
Returns
View Source
IsPrimitiveImpl()
Declaration
protected override bool IsPrimitiveImpl()
Returns
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.
|
| Dictionary<string, Type> |
modelTypes |
The model types map.
|
Returns
| Type |
Description |
| Type |
The actual CLR type.
|
View Source
Map(Type, Dictionary<string, Type>?, bool)
Gets the actual CLR type by replacing model types, if any.
Declaration
public static Type Map(Type type, Dictionary<string, Type>? modelTypes, bool dictionaryIsInvariant)
Parameters
| Type |
Name |
Description |
| Type |
type |
The type.
|
| Dictionary<string, Type> |
modelTypes |
The model types map.
|
| bool |
dictionaryIsInvariant |
A value indicating whether the dictionary is case-insensitive.
|
Returns
| Type |
Description |
| Type |
The actual CLR type.
|
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.
|
| Dictionary<string, string> |
map |
The model types map.
|
Returns
| Type |
Description |
| string |
The actual CLR type name.
|
View Source
ToString()
Declaration
public override string ToString()
Returns