Interface IObjectStore

The main interface for object store implementations.

Namespace: EPiServer.BaseLibrary
Assembly: EPiServer.BaseLibrary.dll
Version: 8.11.0
Syntax
public interface IObjectStore

Properties

ObjectStoreId

A unique identity for the specific instance of an object store.

Declaration
string ObjectStoreId { get; }
Property Value
Type Description
System.String

Methods

AddRelation(Object, Object)

Adds a relation from one object to another.

Declaration
void AddRelation(object fromId, object toId)
Parameters
Type Name Description
System.Object fromId

The source object of the relation.

System.Object toId

The destination object of the relation.

BeginTransaction()

Start a new transaction for the current connection.

Declaration
void BeginTransaction()
Remarks

If there is already an active transaction for this connection, do nothing.

CloseConnection()

Release any resources needed to access the underlying storage.

Declaration
void CloseConnection()
Remarks

The implementation must obey the following assumptions:

CommitTransaction()

Commit the current transaction.

Declaration
void CommitTransaction()
Remarks

If there is no active transaction, do nothing.

CreatePath(String, IItem)

Creates a new path or loads an item if the path exists.

Declaration
IItem CreatePath(string path, IItem current)
Parameters
Type Name Description
System.String path

The object store path to create.

IItem current

The item to start creating from. Must be null if path is a root path.

Returns
Type Description
IItem

An initialized IItem.

CreateSessionStore()

TODO

Declaration
IObjectStore CreateSessionStore()
Returns
Type Description
IObjectStore

Delete(Object)

Deletes an item. If the item does not exist, just returns.

Declaration
void Delete(object id)
Parameters
Type Name Description
System.Object id

The identity of the item to delete.

ExecuteQueryId<ITEMTYPE>(Query)

Executes a query and returns a list of the identities of the matching items.

Declaration
IList ExecuteQueryId<ITEMTYPE>(Query query)

    where ITEMTYPE : IItem
Parameters
Type Name Description
Query query

The query.

Returns
Type Description
System.Collections.IList

A list of item identities.

Type Parameters
Name Description
ITEMTYPE

The type of items to include in the search.

ExecuteQueryObject<ITEMTYPE>(Query)

Executes a query and returns a list of the matching items.

Declaration
IList<ITEMTYPE> ExecuteQueryObject<ITEMTYPE>(Query query)

    where ITEMTYPE : IItem
Parameters
Type Name Description
Query query

The query.

Returns
Type Description
System.Collections.Generic.IList<ITEMTYPE>

A list of ITEMTYPE items.

Type Parameters
Name Description
ITEMTYPE

The type of items to include in the search.

Load(Object)

Load item with the given identity.

Declaration
IItem Load(object id)
Parameters
Type Name Description
System.Object id

The item identity.

Returns
Type Description
IItem

An initialized IItem. Returns null if the item is not found.

Remarks

This method will only return null if the item does not exist. Any other failure will generate an ObjectStoreException.

LoadPath(String, IItem)

Loads an item given its path.

Declaration
IItem LoadPath(string path, IItem current)
Parameters
Type Name Description
System.String path

The object store path to the item.

IItem current

The item to start searching from. Must be null if path is a root path.

Returns
Type Description
IItem

An initialized IItem. Returns null if the item is not found.

OpenConnection()

Acquire the resources needed to access the underlying storage.

Declaration
void OpenConnection()

RelatedItemsFrom(Object)

Returns all items with a relation from a specific item.

Declaration
IList<IItem> RelatedItemsFrom(object fromId)
Parameters
Type Name Description
System.Object fromId

The identity of the item to find relations from.

Returns
Type Description
System.Collections.Generic.IList<IItem>

A list of items.

RelatedItemsFrom<ITEMTYPE>(Object)

Returns all items of a specific type with a relation from a specific item.

Declaration
IList<ITEMTYPE> RelatedItemsFrom<ITEMTYPE>(object fromId)

    where ITEMTYPE : IItem
Parameters
Type Name Description
System.Object fromId

The identity of the item to find relations from.

Returns
Type Description
System.Collections.Generic.IList<ITEMTYPE>

A list of ITEMTYPE items.

Type Parameters
Name Description
ITEMTYPE

The type of items to find.

RelatedItemsTo(Object)

Returns all items with a relation to a specific item.

Declaration
IList<IItem> RelatedItemsTo(object toId)
Parameters
Type Name Description
System.Object toId

The identity of the item to find relations to.

Returns
Type Description
System.Collections.Generic.IList<IItem>

A list of items.

RelatedItemsTo<ITEMTYPE>(Object)

Returns all items of a specific type with a relation from a specific item.

Declaration
IList<ITEMTYPE> RelatedItemsTo<ITEMTYPE>(object toId)

    where ITEMTYPE : IItem
Parameters
Type Name Description
System.Object toId

The identity of the item to find relations to.

Returns
Type Description
System.Collections.Generic.IList<ITEMTYPE>

A list of ITEMTYPE items.

Type Parameters
Name Description
ITEMTYPE

The type of items to find.

RemoveRelation(Object, Object)

Removes an existing relation between two objects.

Declaration
void RemoveRelation(object fromId, object toId)
Parameters
Type Name Description
System.Object fromId

The source object of the relation.

System.Object toId

The destination object of the relation.

RollbackTransaction()

Rollback the current transaction.

Declaration
void RollbackTransaction()
Remarks

If there is no active transaction, do nothing.

Save(IItem)

Saves an item.

Declaration
bool Save(IItem item)
Parameters
Type Name Description
IItem item

The item to save.

Returns
Type Description
System.Boolean

True if the item was created in the object store, False if an existing item was updated.

TestClearItems()

Declaration
void TestClearItems()

Extension Methods