Class Element
Represents an Element object
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[DataContract(IsReference = true)]
public class Element : PublishableContentBase, IElement, IPublishableContentBase, IContentBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceElement(string, int, IContentType, int, string?)
Constructor for creating an Element object
Declaration
public Element(string name, int parentId, IContentType contentType, int userId, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the element |
| int | parentId | Id of the Parent folder |
| IContentType | contentType | ContentType for the current Element object |
| int | userId | The identifier of the user creating the Element object |
| string | culture | An optional culture. |
Element(string, int, IContentType?, string?)
Constructor for creating an Element object
Declaration
public Element(string name, int parentId, IContentType? contentType, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the element |
| int | parentId | Id of the Parent folder |
| IContentType | contentType | ContentType for the current Element object |
| string | culture | An optional culture. |
Element(string, int, IContentType?, PropertyCollection, string?)
Constructor for creating an Element object
Declaration
public Element(string name, int parentId, IContentType? contentType, PropertyCollection properties, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the element |
| int | parentId | Id of the Parent folder |
| IContentType | contentType | ContentType for the current Element object |
| PropertyCollection | properties | Collection of properties |
| string | culture | An optional culture. |
Element(string, IContentType, int, string?)
Constructor for creating an Element object
Declaration
public Element(string name, IContentType contentType, int userId, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the element |
| IContentType | contentType | ContentType for the current Element object |
| int | userId | The identifier of the user creating the Element object |
| string | culture | An optional culture. |
Element(string, IContentType, string?)
Constructor for creating an Element object
Declaration
public Element(string name, IContentType contentType, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the element |
| IContentType | contentType | ContentType for the current Element object |
| string | culture | An optional culture. |
Element(string, IContentType, PropertyCollection, string?)
Constructor for creating an Element object
Declaration
public Element(string name, IContentType contentType, PropertyCollection properties, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the element |
| IContentType | contentType | ContentType for the current Element object |
| PropertyCollection | properties | Collection of properties |
| string | culture | An optional culture. |
Methods
View SourceDeepCloneWithResetIdentities()
Creates a deep clone of the current entity with its identity and it's property identities reset
Declaration
public IElement DeepCloneWithResetIdentities()
Returns
| Type | Description |
|---|---|
| IElement |