Class WacEfUnitOfWork<TDbContext>
Inheritance
System.Object
WacEfUnitOfWork<TDbContext>
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: WaCore.Data.Ef.dll
Syntax
public class WacEfUnitOfWork<TDbContext> : IWacUnitOfWork, IDisposable where TDbContext : DbContext
Type Parameters
Name |
Description |
TDbContext |
|
Constructors
|
Improve this Doc
View Source
WacEfUnitOfWork(TDbContext, IServiceProvider)
Declaration
public WacEfUnitOfWork(TDbContext dbContext, IServiceProvider serviceProvider)
Parameters
Type |
Name |
Description |
TDbContext |
dbContext |
|
System.IServiceProvider |
serviceProvider |
|
Fields
|
Improve this Doc
View Source
_dbContext
Declaration
protected readonly TDbContext _dbContext
Field Value
Type |
Description |
TDbContext |
|
|
Improve this Doc
View Source
_repositories
Declaration
protected Dictionary<Type, object> _repositories
Field Value
Type |
Description |
System.Collections.Generic.Dictionary<System.Type, System.Object> |
|
|
Improve this Doc
View Source
_serviceProvider
Declaration
protected readonly IServiceProvider _serviceProvider
Field Value
Type |
Description |
System.IServiceProvider |
|
Properties
|
Improve this Doc
View Source
DbContext
Declaration
public TDbContext DbContext { get; }
Property Value
Type |
Description |
TDbContext |
|
Methods
|
Improve this Doc
View Source
BeginTransaction()
Declaration
public IWacTransaction BeginTransaction()
Returns
|
Improve this Doc
View Source
BeginTransaction(IsolationLevel)
Declaration
public IWacTransaction BeginTransaction(IsolationLevel isolationLevel)
Parameters
Type |
Name |
Description |
System.Data.IsolationLevel |
isolationLevel |
|
Returns
|
Improve this Doc
View Source
BeginTransactionAsync(IsolationLevel, CancellationToken)
Declaration
public Task<IWacTransaction> BeginTransactionAsync(IsolationLevel isolationLevel, CancellationToken cancellationToken = default (CancellationToken))
Parameters
Type |
Name |
Description |
System.Data.IsolationLevel |
isolationLevel |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
BeginTransactionAsync(CancellationToken)
Declaration
public Task<IWacTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default (CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
Dispose()
Declaration
|
Improve this Doc
View Source
GetRepository<TRepository>()
Declaration
public TRepository GetRepository<TRepository>()where TRepository : class
Returns
Type |
Description |
TRepository |
|
Type Parameters
Name |
Description |
TRepository |
|
|
Improve this Doc
View Source
SaveChanges()
Declaration
public void SaveChanges()
|
Improve this Doc
View Source
SaveChangesAsync(CancellationToken)
Declaration
public Task SaveChangesAsync(CancellationToken cancellationToken = default (CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Implements
System.IDisposable