Class BlockTypeRepository
Repository for working with BlockType.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[ServiceConfiguration(typeof(BlockTypeRepository))]
public class BlockTypeRepository : IContentTypeRepository<BlockType>Constructors
BlockTypeRepository(IContentTypeRepository)
Initializes a new instance of the BlockTypeRepository class.
Declaration
public BlockTypeRepository(IContentTypeRepository contentTypeRepository)Parameters
| Type | Name | Description | 
|---|---|---|
| IContentTypeRepository | contentTypeRepository | The content type repository. | 
Methods
Copy(BlockType)
Copies the specified BlockType.
Declaration
public virtual BlockType Copy(BlockType blockType)Parameters
| Type | Name | Description | 
|---|---|---|
| BlockType | blockType | The block type to copy. | 
Returns
| Type | Description | 
|---|---|
| BlockType | The newly created copy. | 
Copy(Int32)
Copies the BlockType with specified id.
Declaration
public virtual BlockType Copy(int id)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | id | The id of the block type to copy. | 
Returns
| Type | Description | 
|---|---|
| BlockType | The newly created copy. | 
Copy(Type)
Copies the BlockType with a model of a specified type.
Declaration
public virtual BlockType Copy(Type modelType)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | modelType | The model type used by the block type. | 
Returns
| Type | Description | 
|---|---|
| BlockType | The newly created copy. | 
Delete(BlockType)
Deletes the specified BlockType.
Declaration
public virtual void Delete(BlockType blockType)Parameters
| Type | Name | Description | 
|---|---|---|
| BlockType | blockType | The block type that will be deleted. | 
Delete(Int32)
Deletes the BlockType with specified id.
Declaration
public virtual void Delete(int id)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | id | The id of the block type that should be deleted. | 
Delete(Type)
Deletes the BlockType with a model of a specified type.
Declaration
public virtual void Delete(Type modelType)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | modelType | The type of the model on the block type that should be deleted. | 
Delete<T>()
Deletes the BlockType with a model of a specified type.
Declaration
public virtual void Delete<T>()
    where T : BlockDataType Parameters
| Name | Description | 
|---|---|
| T | The type of the model on the block type that should be deleted. | 
List()
Lists all registered BlockTypes.
Declaration
public virtual IEnumerable<BlockType> List()Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<BlockType> | A list of block types. | 
Load(Guid)
Loads the BlockType with given guid based identifier.
Declaration
public virtual BlockType Load(Guid guid)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Guid | guid | The GUID of the block type to load. | 
Returns
| Type | Description | 
|---|---|
| BlockType | A block type with the specified GUID. | 
Load(Int32)
Loads the BlockType with given id.
Declaration
public virtual BlockType Load(int id)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | id | The id of the block type to load. | 
Returns
| Type | Description | 
|---|---|
| BlockType | A block type with the specified id. | 
Load(String)
Loads the BlockType with given name.
Declaration
public virtual BlockType Load(string name)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | name | The name of the block type to load. | 
Returns
| Type | Description | 
|---|---|
| BlockType | A block type with the specified name. | 
Load(Type)
Loads the BlockType with given type.
Declaration
public virtual BlockType Load(Type modelType)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | modelType | The type of the model on the block type that should be loaded. | 
Returns
| Type | Description | 
|---|---|
| BlockType | A block type with the specified model type. | 
Load<T>()
Loads the BlockType with given type.
Declaration
public virtual BlockType Load<T>()
    where T : BlockDataReturns
| Type | Description | 
|---|---|
| BlockType | A block type with the specified model type. | 
Type Parameters
| Name | Description | 
|---|---|
| T | The type of the model on the block type that should be loaded. | 
Save(BlockType)
Saves the specified block type.
Declaration
public virtual void Save(BlockType blockType)Parameters
| Type | Name | Description | 
|---|---|---|
| BlockType | blockType | The block type that should be saved. | 
