예제 #1
0
 private void InitializeProperties()
 {
     Storage        = new StorageConfiguration(this);
     BackgroundJobs = new BackgroundJobConfiguration(this);
     Message        = new MessageConfiguration(this);
     Notification   = new NotificationConfiguration(this);
     Validation     = new ValidationConfiguration(this);
     UnitOfWork     = new UnitOfWorkDefaultOptions();
 }
예제 #2
0
        public UnitOfWorkManager(
            IServiceProvider serviceProvider,
            IOptions <UnitOfWorkDefaultOptions> defaultOptions)
        {
            _serviceProvider = serviceProvider;
            _defaultOptions  = defaultOptions.Value;

            _callcontext = new UnitOfWorkCallContext();
        }
예제 #3
0
파일: UnitOfWork.cs 프로젝트: linfx/LinFx
    public UnitOfWork(
        IServiceProvider serviceProvider,
        IUnitOfWorkEventPublisher unitOfWorkEventPublisher,
        IOptions <UnitOfWorkDefaultOptions> options)
    {
        ServiceProvider          = serviceProvider;
        UnitOfWorkEventPublisher = unitOfWorkEventPublisher;
        _defaultOptions          = options.Value;

        _databaseApis    = new Dictionary <string, IDatabaseApi>();
        _transactionApis = new Dictionary <string, ITransactionApi>();
    }
예제 #4
0
        public override void ConfigServices(ModuleConfigServiceContext context)
        {
            //todo : if iunitofworkmanager life is singleton,Internal context will be in conflict.
            context.Services.AddScoped <IUnitOfWorkManager, UnitOfWorkManager>();
            context.Services.AddTransient <IUnitOfWork, UnitOfWork>();

            var defaultUowOptions = new UnitOfWorkDefaultOptions()
            {
                Limit = UnitOfWorkLimit.Required
            };

            context.Services.AddSingleton(Microsoft.Extensions.Options.Options.Create(defaultUowOptions));
        }
예제 #5
0
        private IUnitOfWorkManager GetUnitOfWorkManager()
        {
            IServiceCollection services = new ServiceCollection();

            services.AddScoped <IUnitOfWorkManager, UnitOfWorkManager>();
            services.AddTransient <IUnitOfWork, UnitOfWork>();

            var defaultUowOptions = new UnitOfWorkDefaultOptions()
            {
                Limit = UnitOfWorkLimit.Required
            };

            services.AddSingleton(Microsoft.Extensions.Options.Options.Create(defaultUowOptions));

            var provider = services.BuildServiceProvider();

            return(provider.GetService <IUnitOfWorkManager>());
        }
예제 #6
0
 public AbpUowActionFilter(IUnitOfWorkManager unitOfWorkManager, IOptions <UnitOfWorkDefaultOptions> options)
 {
     _unitOfWorkManager = unitOfWorkManager;
     _defaultOptions    = options.Value;
 }