public UnitOfWorkManager(
     IServiceProvider serviceProvider,
     ICurrentUnitOfWorkProvider currentUnitOfWorkProvider,
     IOptions <UnitOfWorkDefaultOptions> defaultOptions)
 {
     _currentUnitOfWorkProvider = currentUnitOfWorkProvider;
     _defaultOptions            = defaultOptions.Value;
     _serviceProvider           = serviceProvider;
 }
Esempio n. 2
0
        internal void FillDefaultsForNonProvidedOptions(UnitOfWorkDefaultOptions defaultOptions)
        {
            //TODO: Do not change options object..?

            if (!IsTransactional.HasValue)
            {
                IsTransactional = defaultOptions.IsTransactional;
            }

            if (!Scope.HasValue)
            {
                Scope = defaultOptions.Scope;
            }

            if (!Timeout.HasValue && defaultOptions.Timeout.HasValue)
            {
                Timeout = defaultOptions.Timeout.Value;
            }

            if (!IsolationLevel.HasValue && defaultOptions.IsolationLevel.HasValue)
            {
                IsolationLevel = defaultOptions.IsolationLevel.Value;
            }
        }