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(); }
public UnitOfWorkManager( IServiceProvider serviceProvider, IOptions <UnitOfWorkDefaultOptions> defaultOptions) { _serviceProvider = serviceProvider; _defaultOptions = defaultOptions.Value; _callcontext = new UnitOfWorkCallContext(); }
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>(); }
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)); }
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>()); }
public AbpUowActionFilter(IUnitOfWorkManager unitOfWorkManager, IOptions <UnitOfWorkDefaultOptions> options) { _unitOfWorkManager = unitOfWorkManager; _defaultOptions = options.Value; }