Try our conversational search powered by Generative AI!

Interface ISharedBlockFactory

Defines signature for a factory that creates shared instances of BlockData

Namespace: EPiServer.Construction
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public interface ISharedBlockFactory

Methods

CreateAndPopulateSharedBlock(BlockType)

Creates a shared instance of a block of type defined by blockType.

Declaration
IContent CreateAndPopulateSharedBlock(BlockType blockType)
Parameters
Type Name Description
BlockType blockType

Type of the block.

Returns
Type Description
IContent
Remarks

This is the method used by system to create a proxy implementing IContent for a block when loading from database.

This method will populate the block instance with PropertyData instances according to the blockType.

CreateSharedBlock(Type)

Creates a IContent instance by creating a proxy of passed in type (in case of shared block a type inheriting BlockData) and a MixIn class that implements IContent.

Declaration
IContent CreateSharedBlock(Type modelType)
Parameters
Type Name Description
System.Type modelType

Type of the model.

Returns
Type Description
IContent
Remarks

The created IContent will not have backing PropertyData instance in place. Use method CreateAndPopulateSharedBlock(BlockType) to get instance populated as well.

Extension Methods