SaaS CMS has officially launched! Learn more now.

Interface ISession

Summary description for ISession.

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

An ISession implementation is required to have a constructor with the signature (IObjectStore sessionStore, IRepository repository).

Methods

AddRelation(Object, Object)

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

BeginTransaction()

Declaration
void BeginTransaction()

Close()

Declaration
void Close()

CommitTransaction()

Declaration
void CommitTransaction()

CreatePath(String)

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

CreatePath(String, IItem)

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

Delete(Object)

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

ExecuteQueryId<ITEMTYPE>(Query)

Declaration
IList ExecuteQueryId<ITEMTYPE>(Query query)

    where ITEMTYPE : IItem
Parameters
Type Name Description
Query query
Returns
Type Description
System.Collections.IList
Type Parameters
Name Description
ITEMTYPE

ExecuteQueryObject<ITEMTYPE>(Query)

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

    where ITEMTYPE : IItem
Parameters
Type Name Description
Query query
Returns
Type Description
System.Collections.Generic.IList<ITEMTYPE>
Type Parameters
Name Description
ITEMTYPE

Load(Object)

Load an object.

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

Id of the object to load.

Returns
Type Description
IItem

The instantiated object. Null if the object does not exist.

Remarks

Note that two consecutive calls to Load with the same id may yield different results. The first call may return the object and the second call may return null because the object has been deleted. Even if the second call succeeds the Load method may return two different object instances (this behavior is implementation dependent), so the only way to check for two references holding reference to the "same" object is to compare the id.

LoadPath(String)

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

LoadPath(String, IItem)

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

RelatedItemsFrom(Object)

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

RelatedItemsFrom<ITEMTYPE>(Object)

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

    where ITEMTYPE : IItem
Parameters
Type Name Description
System.Object fromId
Returns
Type Description
System.Collections.Generic.IList<ITEMTYPE>
Type Parameters
Name Description
ITEMTYPE

RelatedItemsTo(Object)

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

RelatedItemsTo<ITEMTYPE>(Object)

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

    where ITEMTYPE : IItem
Parameters
Type Name Description
System.Object toId
Returns
Type Description
System.Collections.Generic.IList<ITEMTYPE>
Type Parameters
Name Description
ITEMTYPE

RemoveRelation(Object, Object)

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

RollbackTransaction()

Declaration
void RollbackTransaction()

Save(IItem)

Save 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 it an existing item was updated.

Extension Methods