Show / Hide Table of Contents

Class UnitOfWorkMongoDbContextProvider<TMongoDbContext>

Inheritance
object
UnitOfWorkMongoDbContextProvider<TMongoDbContext>
Implements
IMongoDbContextProvider<TMongoDbContext>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Volo.Abp.Uow.MongoDB
Assembly: Volo.Abp.MongoDB.dll
Syntax
public class UnitOfWorkMongoDbContextProvider<TMongoDbContext> : IMongoDbContextProvider<TMongoDbContext> where TMongoDbContext : IAbpMongoDbContext
Type Parameters
Name Description
TMongoDbContext

Constructors

UnitOfWorkMongoDbContextProvider(IUnitOfWorkManager, IConnectionStringResolver, ICancellationTokenProvider, ICurrentTenant, IOptions<AbpMongoDbContextOptions>, IMongoDbContextTypeProvider)

Declaration
public UnitOfWorkMongoDbContextProvider(IUnitOfWorkManager unitOfWorkManager, IConnectionStringResolver connectionStringResolver, ICancellationTokenProvider cancellationTokenProvider, ICurrentTenant currentTenant, IOptions<AbpMongoDbContextOptions> options, IMongoDbContextTypeProvider dbContextTypeProvider)
Parameters
Type Name Description
IUnitOfWorkManager unitOfWorkManager
IConnectionStringResolver connectionStringResolver
ICancellationTokenProvider cancellationTokenProvider
ICurrentTenant currentTenant
IOptions<AbpMongoDbContextOptions> options
IMongoDbContextTypeProvider dbContextTypeProvider

Fields

CancellationTokenProvider

Declaration
protected readonly ICancellationTokenProvider CancellationTokenProvider
Field Value
Type Description
ICancellationTokenProvider

ConnectionStringResolver

Declaration
protected readonly IConnectionStringResolver ConnectionStringResolver
Field Value
Type Description
IConnectionStringResolver

CurrentTenant

Declaration
protected readonly ICurrentTenant CurrentTenant
Field Value
Type Description
ICurrentTenant

DbContextTypeProvider

Declaration
protected readonly IMongoDbContextTypeProvider DbContextTypeProvider
Field Value
Type Description
IMongoDbContextTypeProvider

Options

Declaration
protected readonly AbpMongoDbContextOptions Options
Field Value
Type Description
AbpMongoDbContextOptions

UnitOfWorkManager

Declaration
protected readonly IUnitOfWorkManager UnitOfWorkManager
Field Value
Type Description
IUnitOfWorkManager

Properties

Logger

Declaration
public ILogger<UnitOfWorkMongoDbContextProvider<TMongoDbContext>> Logger { get; set; }
Property Value
Type Description
ILogger<UnitOfWorkMongoDbContextProvider<TMongoDbContext>>

Methods

CreateDbContextAsync(IUnitOfWork, MongoUrl, string, CancellationToken)

Declaration
protected virtual Task<TMongoDbContext> CreateDbContextAsync(IUnitOfWork unitOfWork, MongoUrl mongoUrl, string databaseName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IUnitOfWork unitOfWork
MongoUrl mongoUrl
string databaseName
CancellationToken cancellationToken
Returns
Type Description
Task<TMongoDbContext>

CreateDbContextWithTransaction(IUnitOfWork, MongoUrl, MongoClient, IMongoDatabase)

Declaration
[Obsolete("Use CreateDbContextWithTransactionAsync")]
protected virtual TMongoDbContext CreateDbContextWithTransaction(IUnitOfWork unitOfWork, MongoUrl url, MongoClient client, IMongoDatabase database)
Parameters
Type Name Description
IUnitOfWork unitOfWork
MongoUrl url
MongoClient client
IMongoDatabase database
Returns
Type Description
TMongoDbContext

CreateDbContextWithTransactionAsync(IUnitOfWork, MongoUrl, MongoClient, IMongoDatabase, CancellationToken)

Declaration
protected virtual Task<TMongoDbContext> CreateDbContextWithTransactionAsync(IUnitOfWork unitOfWork, MongoUrl url, MongoClient client, IMongoDatabase database, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IUnitOfWork unitOfWork
MongoUrl url
MongoClient client
IMongoDatabase database
CancellationToken cancellationToken
Returns
Type Description
Task<TMongoDbContext>

CreateMongoClient(MongoUrl)

Declaration
protected virtual MongoClient CreateMongoClient(MongoUrl mongoUrl)
Parameters
Type Name Description
MongoUrl mongoUrl
Returns
Type Description
MongoClient

GetCancellationToken(CancellationToken)

Declaration
protected virtual CancellationToken GetCancellationToken(CancellationToken preferredValue = default)
Parameters
Type Name Description
CancellationToken preferredValue
Returns
Type Description
CancellationToken

GetDbContext()

Declaration
[Obsolete("Use CreateDbContextAsync")]
public virtual TMongoDbContext GetDbContext()
Returns
Type Description
TMongoDbContext

GetDbContextAsync(CancellationToken)

Declaration
public virtual Task<TMongoDbContext> GetDbContextAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TMongoDbContext>

ResolveConnectionString(Type)

Declaration
[Obsolete("Use ResolveConnectionStringAsync method.")]
protected virtual string ResolveConnectionString(Type dbContextType)
Parameters
Type Name Description
Type dbContextType
Returns
Type Description
string

ResolveConnectionStringAsync(Type)

Declaration
protected virtual Task<string> ResolveConnectionStringAsync(Type dbContextType)
Parameters
Type Name Description
Type dbContextType
Returns
Type Description
Task<string>

Implements

IMongoDbContextProvider<TMongoDbContext>

Extension Methods

AbpObjectExtensions.As<T>(object)
AbpObjectExtensions.To<T>(object)
LockExtensions.Locking(object, Action)
LockExtensions.Locking<TResult>(object, Func<TResult>)
AbpObjectExtensions.If<T>(T, bool, Action<T>)
AbpObjectExtensions.If<T>(T, bool, Func<T, T>)
AbpObjectExtensions.IsIn<T>(T, IEnumerable<T>)
AbpObjectExtensions.IsIn<T>(T, params T[])
AbpQueryableExtensions.OrderByIf<T, TQueryable>(TQueryable, bool, string)
AbpQueryableExtensions.PageBy<T, TQueryable>(TQueryable, int, int)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, bool>>)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, int, bool>>)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
In this article
Back to top Powered by Volosoft