Interface IContentTypeRepository<T>
Defines methods for interacting with a data repository where a type of class ContentTypes are persisted.
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public interface IContentTypeRepository<T>
    where T : ContentTypeType Parameters
| Name | Description | 
|---|---|
| T | The ContentType that is handled by this repository. | 
Methods
Copy(T)
Creates a copy of the specified content type in the data repository and returns it.
Declaration
T Copy(T contentType)Parameters
| Type | Name | Description | 
|---|---|---|
| T | contentType | Type of the content. | 
Returns
| Type | Description | 
|---|---|
| T | 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
T Copy(int id)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | id | The id of the ContentType to be copied. | 
Returns
| Type | Description | 
|---|---|
| T | 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
T Copy(Type modelType)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | modelType | The underlying model System.Type of the ContentType. | 
Returns
| Type | Description | 
|---|---|
| T | The copy of the ContentType that matches the given type. | 
Delete(T)
Deletes a ContentType from the data repository.
Declaration
void Delete(T contentType)Parameters
| Type | Name | Description | 
|---|---|---|
| T | contentType | Type of the content. | 
Delete(Int32)
Deletes a ContentType with the given id from the data repository.
Declaration
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
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
IEnumerable<T> List()Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<T> | Enumeration of ContentTypes. | 
Load(Guid)
Loads a ContentType with the specified System.Guid from the data repository.
Declaration
T Load(Guid guid)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Guid | guid | The ContentType GUID. | 
Returns
| Type | Description | 
|---|---|
| T | 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
T Load(int id)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | id | The ContentType id. | 
Returns
| Type | Description | 
|---|---|
| T | 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
T Load(string name)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | name | The ContentType name. | 
Returns
| Type | Description | 
|---|---|
| T | 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
T Load(Type modelType)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | modelType | The underlying model System.Type of the ContentType. | 
Returns
| Type | Description | 
|---|---|
| T | The ContentType that matches the given System.Type or null if none could be found. | 
Save(T)
Saves the specified ContentType to the data repository.
Declaration
void Save(T contentType)Parameters
| Type | Name | Description | 
|---|---|---|
| T | contentType | Type of the content. | 
