Defines the contract for a Unit of Work. A Unit of Work maintains a list of objects
affected by a business transaction and coordinates the writing out of changes and
the resolution of concurrency problems.
| C# | Visual Basic |
public interface IUnitOfWork : IDisposable
Public Interface IUnitOfWork _ Implements IDisposable
| All Members | Methods | Events | |||
| Icon | Member | Description |
|---|---|---|
| Add(Entity) |
Registers the specified entity as a pending insert.
| |
| Attach(Entity) |
Attaches the specified Entity to the current unit of work.
| |
| BeginTransaction(IsolationLevel) |
Begins a transaction.
| |
| Count(Query) |
Returns the number of entities in the repository that
satisfy the provided query specification.
| |
| Disposed |
Signals that the component has been disposed.
| |
| Find<(Of <(TEntity>)>)(Query) | ||
| Find(Query) | ||
| Find<(Of <(TList>)>)(Query, TList) |
Returns a list of Entity objects that
match the provided Query specification. Places the
results into the provided collection.
| |
| FindOne<(Of <(TEntity>)>)(Query) | ||
| FindOne(Query) | ||
| PrepareCommand(IDbCommand) |
Prepares a IDbCommand to run against the underlying database.
| |
| Project(Query) |
Returns an IDataReader containing the results of the specified
projection query. A projection query returns only a subset of fields of an entity.
At lease one field name must have been added to the Projection
collection.
| |
| Remove(Entity) |
Registers the specified entity as a pending delete.
| |
| SaveChanges(Boolean) |
Flushes pending changes to the database.
|