Example #1
0
 /// <summary>
 ///   Инициализирует хранилище зависимостями <see cref="IEntityFactoryService" />,
 ///   <see cref="IMessagingComponentFactory" />, <see cref="IIntegrationEventMapperFactory" />.
 /// </summary>
 /// <param name="entityFactoryService">Фабричный сервис для инфраструктурных операций с БД.</param>
 /// <param name="messagingComponentFactory">Фабрика компонентов для обмена сообщениями.</param>
 /// <param name="integrationEventMapperFactory">Фабрика подбора преобразователей событий.</param>
 public EventStore(
     IEntityFactoryService entityFactoryService, IMessagingComponentFactory messagingComponentFactory,
     IIntegrationEventMapperFactory integrationEventMapperFactory)
 {
     _entityFactoryService           = entityFactoryService.ThrowIfNull(nameof(entityFactoryService));
     _messagingComponentFactory      = messagingComponentFactory.ThrowIfNull(nameof(messagingComponentFactory));
     _integrationEventMapperStrategy = integrationEventMapperFactory.ThrowIfNull(nameof(integrationEventMapperFactory));
 }
Example #2
0
        public UnitOfWork(
            IEntityFactoryService factoryService, ISessionManager sessionManager, IsolationLevel isolationLevel = IsolationLevel.ReadCommitted,
            bool autoControl = true, bool closeSessions = false)
        {
            _factoryService = factoryService.ThrowIfNull(nameof(factoryService));
            _sessionManager = sessionManager.ThrowIfNull(nameof(sessionManager));
            _isolationLevel = isolationLevel;
            _autoControl    = autoControl;
            _closeSessions  = closeSessions;

            if (!sessionManager.RegisterUoW(this))
            {
                throw new UowException("Unit of Work already exists");
            }

            _sessionManager.StartTransactionAll();
        }
Example #3
0
 public GreetingsQueriesController(IEntityFactoryService efs)
 {
     _efs = efs.ThrowIfNull(nameof(efs));
 }