Raven.Client.AdvancedSessionExtensions.GetDatabaseCommands C# (CSharp) Method

GetDatabaseCommands() public static method

Provides access to DatabaseCommands for the same database that the session was opened for.
public static GetDatabaseCommands ( this session ) : IDatabaseCommands
session this The Raven advanced session.
return IDatabaseCommands
        public static IDatabaseCommands GetDatabaseCommands(this IAdvancedDocumentSessionOperations session)
        {
            // Note - We must cast to a DocumentSession to get the correct DatabaseCommands instance.
            //        session.DocumentStore.DatabaseCommands will not necessarily point at the same database
            //        that the session was opened for.  Hence the usefulness of this extension method.

            return ((DocumentSession) session).DatabaseCommands;
        }