IContentStoreOpenWriteSession Method Ingeniux CMS Content Store API

Opens a read/write session. This session automatically tracks changes made to any objects that were retrieved within this session. It also tracks the newly created and to-be-deleted objects. All saves occur when the session is disposed. If any exceptions occurred before the session is closed, no changes are applied. This system makes it easy to perform transactional changes and prevents any partial changes due to errors before the session is disposed.

Namespace: Ingeniux.CMS
Assembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 9.0.565.0 (9.0.565)
Syntax

IUserWriteSession OpenWriteSession(
	IReadonlyUser user
)

Parameters

user
Type: Ingeniux.CMSIReadonlyUser
The user to open the session. All changes must occur via this user account.

Return Value

Type: IUserWriteSession
The read/write session.
Remarks

The best way to open a session is to use the "using" statement, ensuring it is always disposed properly. If not, make sure to manually dispose the instance.
Examples

C#
IReadonlyUser currentUser = store.GetStartingUser(@"yourfirm\youruserid");
using (IUserSession session = store.OpenWriteSession(currentUser))
{
        ......
}
See Also

Reference