Class TypeModel
Represents a model.
Inheritance
Namespace: Umbraco.Cms.Infrastructure.ModelsBuilder.Building
Assembly: Umbraco.Infrastructure.dll
Syntax
public class TypeModel
Fields
View SourceAlias
Gets the alias of the model.
Declaration
public string Alias
Field Value
Type | Description |
---|---|
System.String |
BaseType
Gets the base model.
Declaration
public TypeModel BaseType
Field Value
Type | Description |
---|---|
TypeModel |
Remarks
If the content type does not have a base content type, then returns null
.
The current model inherits from its base model.
ClrName
Gets the clr name of the model.
Declaration
public string ClrName
Field Value
Type | Description |
---|---|
System.String |
Remarks
This is the complete name eg "Foo.Bar.MyContent".
DeclaringInterfaces
Gets the list of interfaces that this model needs to declare it implements.
Declaration
public readonly List<TypeModel> DeclaringInterfaces
Field Value
Type | Description |
---|---|
List<TypeModel> |
Remarks
Some of these interfaces may actually be implemented by a base model that this model inherits from.
Description
Gets the description of the content type.
Declaration
public string Description
Field Value
Type | Description |
---|---|
System.String |
HasBase
Gets a value indicating whether this model has a base class.
Declaration
public bool HasBase
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
Can be either because the content type has a base content type declared in Umbraco, or because the existing user's code declares a base class for this model.
Id
Gets the unique identifier of the corresponding content type.
Declaration
public int Id
Field Value
Type | Description |
---|---|
System.Int32 |
ImplementingInterfaces
Gets the list of interfaces that this model needs to actually implement.
Declaration
public readonly List<TypeModel> ImplementingInterfaces
Field Value
Type | Description |
---|---|
List<TypeModel> |
IsMixin
Gets a value indicating whether this model is used as a mixin by another model.
Declaration
public bool IsMixin
Field Value
Type | Description |
---|---|
System.Boolean |
IsParent
Gets a value indicating whether this model is the base model of another model.
Declaration
public bool IsParent
Field Value
Type | Description |
---|---|
System.Boolean |
MixinTypes
Gets the mixin models.
Declaration
public readonly List<TypeModel> MixinTypes
Field Value
Type | Description |
---|---|
List<TypeModel> |
Remarks
The current model implements mixins.
Name
Gets the name of the content type.
Declaration
public string Name
Field Value
Type | Description |
---|---|
System.String |
ParentId
Gets the unique identifier of the parent.
Declaration
public int ParentId
Field Value
Type | Description |
---|---|
System.Int32 |
Remarks
The parent can either be a base content type, or a content types container. If the content
type does not have a base content type, then returns -1
.
Properties
Gets the list of properties that are defined by this model.
Declaration
public readonly List<PropertyModel> Properties
Field Value
Type | Description |
---|---|
List<PropertyModel> |
Remarks
These are only those property that are defined locally by this model, and the list does not contain properties inherited from base models or from mixins.
Properties
View SourceIsElement
Gets a value indicating whether the type is an element.
Declaration
public bool IsElement { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ItemType
Gets or sets the model item type.
Declaration
public TypeModel.ItemTypes ItemType { get; set; }
Property Value
Type | Description |
---|---|
TypeModel.ItemTypes |
Methods
View SourceEnumerateBaseTypes(Boolean)
Enumerates the base models starting from the current model up.
Declaration
public IEnumerable<TypeModel> EnumerateBaseTypes(bool andSelf = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | andSelf | Indicates whether the enumeration should start with the current model or from its base model. |
Returns
Type | Description |
---|---|
IEnumerable<TypeModel> | The base models. |
MapModelTypes(IList<TypeModel>, String)
Maps ModelType.
Declaration
public static void MapModelTypes(IList<TypeModel> typeModels, string ns)
Parameters
Type | Name | Description |
---|---|---|
IList<TypeModel> | typeModels | |
System.String | ns |