Click or drag to resize

IUserWriteSession Interface


Represents a communication session used not only to retrieve objects from the content store, but also to create, delete, and modify objects. It is also the place to get all manager instances.

Namespace: Ingeniux.CMS
Assembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.492
Syntax
public interface IUserWriteSession : IUserSession, 
	IManagersHost, IInstanceLogger, IDisposable

The IUserWriteSession type exposes the following members.

Properties
 NameDescription
Public propertyClosed Checks if this session was already closed.
(Inherited from IUserSession)
Public propertyCompleteProgressOnCloseObsolete.
Gets/sets whether to complete the progress upon closing this session.
Public propertyContentFreezeStartingTime Gets the time when content freeze is about to start. Null if no content freeze looming.
(Inherited from IUserSession)
Public propertyContext Holds the user session context
(Inherited from IUserSession)
Public propertyCustomMessenger Instance of a CustomHookPushMessenger used to push messages to clients
(Inherited from IUserSession)
Public propertyGlobalExports Gets the definition of exports that will be included as attributes in every link and navigation entry.
(Inherited from IManagersHost)
Public propertyGlobalVariables Gets the collection of global variables.
(Inherited from IManagersHost)
Public propertyId Gets the unique ID of this session.
(Inherited from IUserSession)
Public propertyIP The IP address this session was created for. Could be null if request is from http access
(Inherited from IUserSession)
Public propertyIsDebugEnabled Returns if the current logging instance has debug level enabled.
(Inherited from IInstanceLogger)
Public propertyLingualMappingManager Gets the manager of lingual maps between pages within a specific locale.
(Inherited from IManagersHost)
Public propertyLocalesManager Gets the manager of built-in locales and custom locales.
(Inherited from IManagersHost)
Public propertyLoggingManager Gets the manager of publishing logs and replication logs
(Inherited from IManagersHost)
Public propertyMobileDeviceManager Gets the manager of device bundles for mobile preview emulation.
(Inherited from IManagersHost)
Public propertyOperatingUser Gets the user who owns this session.
(Inherited from IUserSession)
Public propertyPageCreationRulesManager Gets the manager of page creation rules.
(Inherited from IManagersHost)
Public propertyPresentationsManager Gets the presentations manager for managing presentation content units
(Inherited from IManagersHost)
Public propertyProgress Gets the progress report tracker
Public propertyPublishingManager Gets the manager of publishing targets and publishing profiles
(Inherited from IManagersHost)
Public propertyReferencesManager Gets the manager of references between pages.
(Inherited from IManagersHost)
Public propertySchemasManager Gets the manager of schemas.
(Inherited from IManagersHost)
Public propertySettings Gets the CMS settings collection.
(Inherited from IManagersHost)
Public propertySite Gets the manager of pages, page versions, and pages tree structure.
(Inherited from IManagersHost)
Public propertySiteContentLocalizationProvider Gets the manager of translations of page creation rules, schemas, workstates and workflow definitions.
(Inherited from IManagersHost)
Public propertySiteMap Gets the manager of branding types like sites and user agents
(Inherited from IManagersHost)
Public propertyStartTime Gets the time that this session was opened.
(Inherited from IUserSession)
Public propertyTaxonomyManager Gets the manager of category nodes as well as their structure.
(Inherited from IManagersHost)
Public propertyTransactions Gets a generic Transactional Entity to run reduced and other read-only queries.
(Inherited from IManagersHost)
Public propertyUnmanagedAssetManager Gets the unmanaged asset manager for handling legacy unmanaged assets on disk
(Inherited from IManagersHost)
Public propertyUserManager Gets the manager of users, user groups, and group roles for custom permissions collections.
(Inherited from IManagersHost)
Public propertyWorkflowAdministrator Gets the manager of workflow definitions, workstates, and workflows
(Inherited from IManagersHost)
Top
Methods
 NameDescription
Public methodAddT Adds a new object to the content store. Objects are saved to the content store upon session closure.
Public methodCancelSaving Prevents session from saving any changes.
Public methodCommit Manually saves changes to the content store.
Public methodCountTObsolete.
Gets the count of query results
(Inherited from IUserSession)
Public methodDebug Log a message at the Debug level
(Inherited from IInstanceLogger)
Public methodDeleteT Deletes an existing object from the content store. Deletion occurs upon session closure.
Public methodDeleteByIds Deletes existing objects by their object IDs. Deletion occurs upon session closure.
Public methodError Log a message at the Error level
(Inherited from IInstanceLogger)
Public methodExists Checks whether an object with given unique ids exists or not
(Inherited from IUserSession)
Public methodGetT Retrieves an Entity object from the Content Store by its unique ID
(Inherited from IUserSession)
Public methodGetDocumentsRawT Retrieves from the content store by unique ID a collection of documents.
(Inherited from IUserSession)
Public methodGetEntitiesT, TManager Retrieves from the content store by unique ID a collection of entities that implements the IEntityTManager interface.
(Inherited from IUserSession)
Public methodGetEntityT, TManager Retrieves by unique ID from the content store an entity object that implements the IEntityTManager interface.
(Inherited from IUserSession)
Public methodGetManagerT Retrieves a transactional manager that can be used to manipulate entities in the session.
(Inherited from IUserSession)
Public methodIgnoreT Ignore any changed to a loaded object. This will allow the object to still use its session but not commit any changes.
Public methodInfo Log a message at the Info level
(Inherited from IInstanceLogger)
Public methodListT Creates a RavenDB IRavenQueryable instance of the specified collection type
(Inherited from IUserSession)
Public methodLog Log a message at the specified log level
(Inherited from IInstanceLogger)
Public methodCode exampleLuceneQueryAllT, TIndex

Queries the content store using Lucene query syntax, returning a collection of objects of the given type.

The CSAPI creates indexes in the content store to expedite object lookup. The CSAPI comes with a set of indexes for its basic functionality. All strong-typed queries go through this method. Additional custom indexes can be created to provide further flexibility on fast lookup. Please refer to the Indexing topic for more information on indexes and custom indexes.


(Inherited from IUserSession)
Public methodLuceneQueryCountT, TIndex Queries the content store using Lucene query syntax and returns the count of results.
(Inherited from IUserSession)
Public methodQueryT, TIndex

Queries the content store and returns a collection of objects of a given type. The query is based on the type of index provided.

The CSAPI creates indexes in the content store to expedite object lookup. CSAPI comes with a set of indexes for its basic functionality. All strong-typed queries go through this method. Additional custom indexes can be created to provide even further flexibilities on fast lookup. Please refer to the Indexing topic for more information on indexes and custom indexes.


(Inherited from IUserSession)
Public methodStreamQueryAllT, TIndex

Queries the content store using a LINQ expression, returning a collection of objects of the given type.

The CSAPI creates indexes in the content store to expedite object lookup. The CSAPI comes with a set of indexes for its basic functionality. All strong-typed queries go through this method. Additional custom indexes can be created to provide further flexibility on fast lookup. Please refer to the Indexing topic for more information on indexes and custom indexes.


(Inherited from IUserSession)
Public methodWarn Log a message at the Warn level
(Inherited from IInstanceLogger)
Top
Remarks

Objects retrieved within the session are only usable until the session is disposed. That means their methods don't work outside the session, their properties are not guaranteed to work outside the session.

UserSession objects are created from a persisting ContentStore object via the method OpenReadSession(IReadonlyUser). The best way to open and close a UserSession is with a "using" statement:

Example
C#
using (IUserWriteSession session = store.OpenWriteSession(currentUser))
{
    ...
}

Objects retrieved via UserWriteSession are automatically tracked for their changes. The changes are saved to the content store when the sesison is disposed. However, you can always manually perform saves via Commit method at any time.

If the objects are intended to be changed, use the UserWriteSession object.

See Also