C# Класс Amnesia.Session

Наследование: IDisposable
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
CloseConnections void
LogResponse void
LogResponse void
RaiseAfterSessionEnded void

Открытые методы

Метод Описание
Dispose ( ) : void
GetConnection ( string connectionString, DbConnection>.Func createConnection ) : IDbConnection

Gets or creates a connection that can be used with the current session. If there is no active session, null is returned. This connection can and should be shared across threads for transaction rollbacks to work properly.

LockConnection ( IDbConnection connection ) : IDisposable

Because session connections can be shared across threads access to them must be synchronized. For normal connections that are not part of a distributed transaction no locking is performed for better performance.

NewAsyncActivity ( ) : IAsyncActivity

Registers an activity with the session. This method only needs to be called on threads that are not tied to an HttpContext.

NewParallelActivity ( ) : IParallelActivity

Registers an multithreaded activity with the session that will execute synchronously relative to the current activity already underway. In other words, the parallel activity must complete prior to the current activity completing (unlike NewAsyncActivity).

PrepareForDispose ( ) : void
ResetServer ( string serviceUrl, ILog log ) : void

Ensures that there is not an open session. Typically sessions should be ended by calling Dispose() but this can be used at the very start of a test to ensure that the system is in a known state.

Session ( Uri appUrl ) : System

Starts a new Amnesia session with a remote application

Session ( Uri appUrl, ILog log ) : System

Starts a new Amnesia session with a remote application

Session ( string appUrl ) : System

Starts a new Amnesia session with a remote application

Session ( string appUrl, ILog log ) : System

Starts a new Amnesia session with a remote application

Приватные методы

Метод Описание
CloseConnections ( ILog log ) : void

Closes all database connections associated with the session.

LogResponse ( Handler response ) : void
LogResponse ( Handler response, ILog log ) : void
RaiseAfterSessionEnded ( ) : void

Called by a single thread when the session has ended

Описание методов

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetConnection() публичный статический Метод

Gets or creates a connection that can be used with the current session. If there is no active session, null is returned. This connection can and should be shared across threads for transaction rollbacks to work properly.
public static GetConnection ( string connectionString, DbConnection>.Func createConnection ) : IDbConnection
connectionString string
createConnection DbConnection>.Func
Результат IDbConnection

LockConnection() публичный статический Метод

Because session connections can be shared across threads access to them must be synchronized. For normal connections that are not part of a distributed transaction no locking is performed for better performance.
public static LockConnection ( IDbConnection connection ) : IDisposable
connection IDbConnection
Результат IDisposable

NewAsyncActivity() публичный статический Метод

Registers an activity with the session. This method only needs to be called on threads that are not tied to an HttpContext.
public static NewAsyncActivity ( ) : IAsyncActivity
Результат IAsyncActivity

NewParallelActivity() публичный статический Метод

Registers an multithreaded activity with the session that will execute synchronously relative to the current activity already underway. In other words, the parallel activity must complete prior to the current activity completing (unlike NewAsyncActivity).
public static NewParallelActivity ( ) : IParallelActivity
Результат IParallelActivity

PrepareForDispose() публичный Метод

public PrepareForDispose ( ) : void
Результат void

ResetServer() публичный статический Метод

Ensures that there is not an open session. Typically sessions should be ended by calling Dispose() but this can be used at the very start of a test to ensure that the system is in a known state.
public static ResetServer ( string serviceUrl, ILog log ) : void
serviceUrl string
log ILog
Результат void

Session() публичный Метод

Starts a new Amnesia session with a remote application
public Session ( Uri appUrl ) : System
appUrl System.Uri
Результат System

Session() публичный Метод

Starts a new Amnesia session with a remote application
public Session ( Uri appUrl, ILog log ) : System
appUrl System.Uri
log ILog
Результат System

Session() публичный Метод

Starts a new Amnesia session with a remote application
public Session ( string appUrl ) : System
appUrl string
Результат System

Session() публичный Метод

Starts a new Amnesia session with a remote application
public Session ( string appUrl, ILog log ) : System
appUrl string
log ILog
Результат System