November Happy Hour will be moved to Thursday December 5th.

Class BasicContent

A basic implementation of IContent. Can be used as base class for custom IContent implementations.

Inheritance
System.Object
BasicContent
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public class BasicContent : ContentData, IInitializableContent, IModifiedTrackable, IContent, IContentData, IReadOnly, IChangeTrackable, IExportable

Constructors

BasicContent()

Declaration
public BasicContent()

Properties

Changed

Gets the date when this content instance was last marked as changed.

Declaration
public virtual DateTime Changed { get; set; }
Property Value
Type Description
System.DateTime
Remarks

The changed date is only updated when property SetChangedOnPublish is set to true.

ChangedBy

Gets the username of the user that most recently changed this content instance.

Declaration
public virtual string ChangedBy { get; set; }
Property Value
Type Description
System.String
Remarks

For instance, if a Windows account was used to create the instance, expect a string being returned looking like 'DOMAIN\User Name'.

ContentGuid

Gets or sets the content GUID.

Declaration
public virtual Guid ContentGuid { get; set; }
Property Value
Type Description
System.Guid

The content GUID.

Gets or sets the content link. It used to hold references to content in the EPiServer system.

Declaration
public virtual ContentReference ContentLink { get; set; }
Property Value
Type Description
ContentReference

The content link.

ContentTypeID

Gets or sets the content type ID that this BasicContent is an instance of.

Declaration
public virtual int ContentTypeID { get; set; }
Property Value
Type Description
System.Int32

The content type ID.

Created

Gets the date and time when this content instance was created.

Declaration
public virtual DateTime Created { get; set; }
Property Value
Type Description
System.DateTime
Remarks

Created is maintained by the EPiServer infrastructure and you have no control over them.

CreatedBy

Gets the username of the user that created this content instance.

Declaration
public virtual string CreatedBy { get; set; }
Property Value
Type Description
System.String

Deleted

Gets or sets the deleted date.

Declaration
public virtual DateTime? Deleted { get; set; }
Property Value
Type Description
System.Nullable<System.DateTime>

The deleted date.

DeletedBy

Gets or sets the deleted by.

Declaration
public virtual string DeletedBy { get; set; }
Property Value
Type Description
System.String

The deleted by.

IsDeleted

Gets or sets a value indicating whether this instance is deleted.

Declaration
public virtual bool IsDeleted { get; set; }
Property Value
Type Description
System.Boolean

true if this instance is deleted; otherwise, false.

IsModified

Gets a value indicating whether this instance has been modified after loading.

Declaration
protected override bool IsModified { get; }
Property Value
Type Description
System.Boolean

true if this instance has been modified; otherwise, false.

Overrides

Name

Gets or sets the name.

Declaration
public virtual string Name { get; set; }
Property Value
Type Description
System.String

The name.

Gets or sets the parent link. It used to hold references to the parent content in the EPiServer system.

Declaration
public virtual ContentReference ParentLink { get; set; }
Property Value
Type Description
ContentReference

The parent link.

Saved

Gets the date and time when this content instance was last saved.

Declaration
public virtual DateTime Saved { get; set; }
Property Value
Type Description
System.DateTime
Remarks

Saved is the sibling of Created and is maintained by the EPiServer infrastructure. This means that you have no control over them.

SetChangedOnPublish

Gets or sets a value indicating whether the Changed should be updated on publish.

Declaration
public virtual bool SetChangedOnPublish { get; set; }
Property Value
Type Description
System.Boolean

true if Changed should be updated; otherwise, false.

ShouldBeImplicitlyExported

Gets a value indicating whether this instance should be implicitly added to export package when referenced by some entity that is exported.

Declaration
protected virtual bool ShouldBeImplicitlyExported { get; }
Property Value
Type Description
System.Boolean

true if instance should implicity be added to export package when referenced; otherwise, false.

Remarks

Default implementation returns true.

Methods

CreateWriteableCloneImplementation()

Creates a writable clone of this object.

Declaration
protected override object CreateWriteableCloneImplementation()
Returns
Type Description
System.Object

A clone of this object that is writable.

Overrides
Remarks

This method is called by CreateWritableClone(). If you are inheriting, directly or indirectly, from ContentData you should override this method to make sure that all reference type members of your class are cloned.

Your override of this method must create the clone by calling base.CreateWritableCloneImplementation(). This ensures that all classes in the inheritance chain can create clones as necessary. Also, by calling the base implementation the values of all value type members are copied as the ContentData implementation of this method calls System.Object.MemberwiseClone().

MakeReadOnly()

Makes the current instance and all it's properties read-only.

Declaration
public override void MakeReadOnly()
Overrides
Remarks

After calling this method the IsReadOnly property will return true.

ResetModified()

Resets the modified flag on all the properties in the Property collection.

Declaration
protected override void ResetModified()
Overrides

Explicit Interface Implementations

IExportable.ShouldBeImplicitlyExported

Gets a value indicating whether this instance should be implicitly added to export package when referenced by some entity that is exported.

Declaration
bool IExportable.ShouldBeImplicitlyExported { get; }
Returns
Type Description
System.Boolean

true if instance should implicity be added to export package when referenced; otherwise, false.

Implements

Extension Methods

EPiServer.Core.IContentExtensions.GetPropertyName<TContent>(TContent, System.Linq.Expressions.Expression<System.Func<TContent, System.Object>>)
EPiServer.Core.IContentExtensions.GetTargetFrame(EPiServer.Core.IContent)
EPiServer.Core.IContentExtensions.GetForceCurrentVersionSaveAction(EPiServer.Core.IContent)