namespace: Serenity.Data assembly: Serenity.Net.Data
Initializes a new instance of the UnitOfWork
class.
public UnitOfWork(IDbConnection connection)
parameter | description |
---|---|
connection | The connection. |
exception | condition |
---|---|
ArgumentNullException | connection |
- class UnitOfWork
namespace: Serenity.Data assembly: Serenity.Net.Data
Initializes a new instance of the UnitOfWork
class.
public UnitOfWork(IDbConnection connection, bool deferStart)
parameter | description |
---|---|
connection | The connection. |
deferStart | Defers starting of the transaction until the connection is opened if it has a statechange event, or the first moment connection property is read. If the connection is already open this flag has no effect. If the passed connection does not have a statechange event and is accessed somewhere else (e.g. other than via the UnitOfWork.Connection property), it may cause consistency issues so ensure it is not accessed via other means. |
exception | condition |
---|---|
ArgumentNullException | connection |
ArgumentNullException | connection |
- class UnitOfWork
namespace: Serenity.Data assembly: Serenity.Net.Data
Initializes a new instance of the UnitOfWork
class with the specified System.Data.IsolationLevel value.
public UnitOfWork(IDbConnection connection, IsolationLevel il, bool deferStart = false)
parameter | description |
---|---|
connection | The connection. |
il | One of the IsolationLevel values. |
deferStart | Defers starting of the transaction until the connection is opened if it has a statechange event, or the first moment connection property is read. If the connection is already open this flag has no effect. If the passed connection does not have a statechange event and is accessed somewhere else (e.g. other than via the UnitOfWork.Connection property), it may cause consistency issues so ensure it is not accessed via other means. |
exception | condition |
---|---|
ArgumentNullException | connection |
- class UnitOfWork