32 lines
928 B
C#
32 lines
928 B
C#
|
|
using Microsoft.Extensions.DependencyInjection;
|
|||
|
|
using Volo.Abp.AuditLogging.MongoDB;
|
|||
|
|
using Volo.Abp.BackgroundJobs.MongoDB;
|
|||
|
|
using Volo.Abp.Modularity;
|
|||
|
|
using Volo.Abp.MongoDB;
|
|||
|
|
using Volo.Abp.Uow;
|
|||
|
|
|
|||
|
|
namespace JiShe.CollectBus.MongoDB;
|
|||
|
|
|
|||
|
|
[DependsOn(
|
|||
|
|
typeof(CollectBusDomainModule),
|
|||
|
|
typeof(AbpMongoDbModule),
|
|||
|
|
typeof(AbpBackgroundJobsMongoDbModule),
|
|||
|
|
typeof(AbpAuditLoggingMongoDbModule)
|
|||
|
|
)]
|
|||
|
|
public class CollectBusMongoDbModule : AbpModule
|
|||
|
|
{
|
|||
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|||
|
|
{
|
|||
|
|
context.Services.AddMongoDbContext<CollectBusMongoDbContext>(options =>
|
|||
|
|
{
|
|||
|
|
options.AddDefaultRepositories();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
|
|||
|
|
Configure<AbpUnitOfWorkDefaultOptions>(options =>
|
|||
|
|
{
|
|||
|
|
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|