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

Class ContentTypeRepository

Repository for the ContentType data structure.

Inheritance
System.Object
ContentTypeRepository
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.DataAbstraction
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public abstract class ContentTypeRepository : IContentTypeRepository, IContentTypeRepository<ContentType>

Constructors

ContentTypeRepository()

Declaration
protected ContentTypeRepository()

Methods

Copy(ContentType)

Creates a copy of the specified content type in the data repository and returns it.

Declaration
public abstract ContentType Copy(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

The ContentType to be copied.

Returns
Type Description
ContentType

The copy of the ContentType that was provided.

Copy(Int32)

Creates a copy of the specified content type in the data repository and returns it.

Declaration
public virtual ContentType Copy(int id)
Parameters
Type Name Description
System.Int32 id

The id of the ContentType to be copied.

Returns
Type Description
ContentType

The copy of the ContentType that matches the given id.

Copy(Type)

Creates a copy of the specified content type in the data repository and returns it.

Declaration
public virtual ContentType Copy(Type modelType)
Parameters
Type Name Description
System.Type modelType

The underlying System.Type of the ContentType.

Returns
Type Description
ContentType

The copy of the ContentType that matches the given type.

Delete(ContentType)

Deletes a ContentType from the data repository.

Declaration
public abstract void Delete(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

The content type that is to be deleted.

Delete(Int32)

Deletes a ContentType with the given id from the data repository.

Declaration
public virtual void Delete(int id)
Parameters
Type Name Description
System.Int32 id

The ContentType id.

Delete(Type)

Deletes a ContentType with the underlying System.Type from the data repository.

Declaration
public virtual void Delete(Type modelType)
Parameters
Type Name Description
System.Type modelType

The underlying System.Type of the ContentType.

List()

Lists all ContentTypes in the data repository.

Declaration
public abstract IEnumerable<ContentType> List()
Returns
Type Description
System.Collections.Generic.IEnumerable<ContentType>

Enumeration of ContentTypes.

Load(Guid)

Loads a ContentType with the specified System.Guid from the data repository.

Declaration
public abstract ContentType Load(Guid guid)
Parameters
Type Name Description
System.Guid guid

The ContentType GUID.

Returns
Type Description
ContentType

The ContentType that matches the given System.Guid or null if none could be found.

Load(Int32)

Loads a ContentType with the specified id from the data repository.

Declaration
public abstract ContentType Load(int id)
Parameters
Type Name Description
System.Int32 id

The ContentType id.

Returns
Type Description
ContentType

The ContentType that matches the given id or null if none could be found.

Load(String)

Loads a ContentType with the specified name from the data repository.

Declaration
public abstract ContentType Load(string name)
Parameters
Type Name Description
System.String name

The ContentType name.

Returns
Type Description
ContentType

The ContentType that matches the given name or null if none could be found.

Load(Type)

Loads a ContentType with the underlying System.Type from the data repository.

Declaration
public abstract ContentType Load(Type modelType)
Parameters
Type Name Description
System.Type modelType

The underlying System.Type of the ContentType.

Returns
Type Description
ContentType

The ContentType that matches the given System.Type or null if none could be found.

OnContentTypeDeleted(ContentType, ContentTypeEventArgs)

Raises the ContentTypeDeleted event.

Declaration
protected virtual void OnContentTypeDeleted(ContentType contentType, ContentTypeEventArgs args)
Parameters
Type Name Description
ContentType contentType

Type of the content.

ContentTypeEventArgs args

The ContentTypeEventArgs instance containing the event data.

OnContentTypeSaved(ContentType, ContentTypeEventArgs)

Raises the ContentTypeSaved event.

Declaration
protected virtual void OnContentTypeSaved(ContentType contentType, ContentTypeEventArgs args)
Parameters
Type Name Description
ContentType contentType

Type of the content.

ContentTypeEventArgs args

The ContentTypeEventArgs instance containing the event data.

Save(ContentType)

Saves the specified ContentType to the data repository.

Declaration
public abstract void Save(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

Type content type to save.

Events

ContentTypeDeleted

Occurs when a ContentType has been deleted.

Declaration
public static event EventHandler<ContentTypeEventArgs> ContentTypeDeleted
Event Type
Type Description
System.EventHandler<ContentTypeEventArgs>

ContentTypeSaved

Occurs when a ContentType has been saved, i.e. created or updated.

Declaration
public static event EventHandler<ContentTypeEventArgs> ContentTypeSaved
Event Type
Type Description
System.EventHandler<ContentTypeEventArgs>

Implements

Extension Methods