Try our conversational search powered by Generative AI!

Interface IEntityProvider

Defines a uniform interface for performing entity operations

Namespace: EPiServer.Data.Entity
Assembly: EPiServer.Data.dll
Version: 11.20.7
Syntax
public interface IEntityProvider
Remarks

The primary way of obtaining entity provider instances is through GetEntityProvider(Type). Implementers of this interface will also want to register their entity provider using RegisterEntityProvider(IEntityProvider, Type[]) or through configuration.

Methods

AddEntityInstance(IEntity)

Add a new instance of an IEntity

Declaration
IEntity AddEntityInstance(IEntity entity)
Parameters
Type Name Description
IEntity entity

The entity to add

Returns
Type Description
IEntity

The added IEntity

GetEntityInstance(Type, DbDataReader)

Creates an instance of an object based on its System.Type and a System.Data.Common.DbDataReader

Declaration
object GetEntityInstance(Type type, DbDataReader reader)
Parameters
Type Name Description
System.Type type

System System.Type of the object

System.Data.Common.DbDataReader reader

The System.Data.Common.DbDataReader containing the data of the object

Returns
Type Description
System.Object

GetEntityInstance(Type, Int32)

Creates an instance of an object based on its System.Type and its ID

Declaration
IEntity GetEntityInstance(Type type, int id)
Parameters
Type Name Description
System.Type type

System System.Type of the object

System.Int32 id

ID of the object

Returns
Type Description
IEntity

GetSupportedOperations(Type)

Gets which operations this entity provider supports for the specified type.

Declaration
SupportedOperations GetSupportedOperations(Type type)
Parameters
Type Name Description
System.Type type

The System.Type to check for supported operations

Returns
Type Description
SupportedOperations

The supported operations, possibly multiple values (flags)

RemoveEntityInstance(IEntity)

Remove an existing IEntity

Declaration
void RemoveEntityInstance(IEntity entity)
Parameters
Type Name Description
IEntity entity

The entity to remove

UpdateEntityInstance(IEntity)

Update an existing IEntity

Declaration
void UpdateEntityInstance(IEntity entity)
Parameters
Type Name Description
IEntity entity

The entity to update

Extension Methods

See Also