public AddCustomEntityCommandHandler( IQueryExecutor queryExecutor, ICommandExecutor commandExecutor, CofoundryDbContext dbContext, EntityAuditHelper entityAuditHelper, ICustomEntityCache customEntityCache, IDbUnstructuredDataSerializer dbUnstructuredDataSerializer, IMessageAggregator messageAggregator, ICustomEntityDefinitionRepository customEntityDefinitionRepository, IPermissionValidationService permissionValidationService, ITransactionScopeFactory transactionScopeFactory, ICustomEntityStoredProcedures customEntityStoredProcedures ) { _queryExecutor = queryExecutor; _commandExecutor = commandExecutor; _dbContext = dbContext; _entityAuditHelper = entityAuditHelper; _customEntityCache = customEntityCache; _dbUnstructuredDataSerializer = dbUnstructuredDataSerializer; _messageAggregator = messageAggregator; _customEntityDefinitionRepository = customEntityDefinitionRepository; _permissionValidationService = permissionValidationService; _transactionScopeFactory = transactionScopeFactory; _customEntityStoredProcedures = customEntityStoredProcedures; }
/// <summary> /// 使用<see cref="TransactionScope"/>实现<see cref="IUnitOfWork"/>接口 /// if the parameter <paramref name="isDtcAllowed"/> is true, the connection of UnitOfWork not needed to create. /// else the connection need to create and bound to the thread. /// </summary> /// <param name="isDtcAllowed">是否允许使用DTC</param> /// <param name="transactionScopeFactory">实现<see cref="ITransactionScopeFactory"/>接口的实例,用来创建<see cref="TransactionScope"/></param> /// <param name="unitOfWorkDefinition">实现<see cref="IUnitOfWorkDefinition"/>接口的实例,用来定义事务环境</param> /// <param name="dbProvider">实现<see cref="IDbProvider"/>的实例.</param> public TransactionScopeUnitOfWork(bool isDtcAllowed, ITransactionScopeFactory transactionScopeFactory, IUnitOfWorkDefinition unitOfWorkDefinition, IDbProvider dbProvider) { IsDTCAllowed = isDtcAllowed; if (unitOfWorkDefinition == null) { unitOfWorkDefinition = UnitOfWorkDefinition.DefaultDefinition; } CheckUnitOfWorkDefinition(unitOfWorkDefinition); Definition = unitOfWorkDefinition; if (transactionScopeFactory == null) { transactionScopeFactory = new TransactionScopeFactory(unitOfWorkDefinition); } scope = transactionScopeFactory.GetInstance(); System.Transactions.Transaction.Current.TransactionCompleted += (o, args) => Logger.Debug(m => m("Current transaction completed with status {0}.", args.Transaction.TransactionInformation.Status)); //不允许使用分布式事务,则DAO方式必须使用同一个Connection,需要在事务开始前创建Connection,并放入当前线程中。 if (!IsDTCAllowed) { CheckDbProvider(dbProvider); DbProvider = dbProvider; //开始事务,创建连接,并压入当前线程 BeginTransaction(DbProvider, Definition); } }
public AdminDomain(IConfigRepository cfgRepo, IUserRepository userRepo, IInventoryRepository inventoryRepo, IJwtProvider jwtProvider, ITransactionScopeFactory transactionScopeFactory) { ConfigRepo = cfgRepo; UserRepo = userRepo; InventoryRepo = inventoryRepo; JwtProvider = jwtProvider; TransactionScopeFactory = transactionScopeFactory; }
public GameDomain(IConfigRepository cfgRepo, IGameRepository gameRepository, UserDomain userDomain, IJwtProvider jwtProvider, ITransactionScopeFactory transactionScopeFactory) { ConfigRepo = cfgRepo; UserDomain = userDomain; GameRepo = gameRepository; JwtProvider = jwtProvider; TransactionScopeFactory = transactionScopeFactory; }
public MessageDomain(IMessageRepository messageRepo, UserDomain userDomain, IHubContext <NotificationHub, IUserClient> hubContext, ITransactionScopeFactory transactionScopeFactory) { MessageRepo = messageRepo; UserDomain = userDomain; SignalRHubContext = hubContext; TransactionScopeFactory = transactionScopeFactory; }
public UserDomain(IUserRepository userRepo, IFriendshipRepository friendRepo, IJwtProvider jwtProvider, IHubContext <NotificationHub, IUserClient> hubContext, ITransactionScopeFactory transactionScopeFactory) { UserRepo = userRepo; FriendRepo = friendRepo; JWTProvider = jwtProvider; TransactionScopeFactory = transactionScopeFactory; SignalRHubContext = hubContext; }
public MessageCategoryController( ITransactionScopeFactory transactionScopeFactory, IQueryProcessor queryProcessor ) { _transactionScopeFactory = transactionScopeFactory; _queryProcessor = queryProcessor; }
public DefaultConfigurator TransactionScopeFactory(ITransactionScopeFactory transactionScopeFactory) { Guard.AgainstNull(transactionScopeFactory, "transactionScopeFactory"); _configuration.TransactionScopeFactory = transactionScopeFactory; return(this); }
public NpcDomain(IInventoryRepository inventoryRepo, IConfigRepository configRepo, InventoryDomain inventoryDomain, INpcStateRepository npcStateRepo, ITransactionScopeFactory transactionScopeFactory) { InventoryRepo = inventoryRepo; ConfigRepo = configRepo; InventoryDomain = inventoryDomain; TransactionScopeFactory = transactionScopeFactory; this.npcStateRepo = npcStateRepo; }
public SearchDomain(UserDomain userDomain, IUserRepository userRepo, IFriendshipRepository friendRepo, IJwtProvider jwtProvider, ITransactionScopeFactory transactionScopeFactory) { UserDomain = userDomain; UserRepo = userRepo; FriendRepo = friendRepo; JWTProvider = jwtProvider; TransactionScopeFactory = transactionScopeFactory; }
public ServiceBusConfigurator TransactionScopeFactory(ITransactionScopeFactory transactionScopeFactory) { Guard.AgainstNull(transactionScopeFactory, "transactionScopeFactory"); configuration.TransactionScopeFactory = transactionScopeFactory; return(this); }
public InventoryDomain(IInventoryRepository inventoryRepo, IConfigRepository configRepo, UserDomain userDomain, IHubContext <NotificationHub, IUserClient> hubContext, ITransactionScopeFactory transactionScopeFactory) { InventoryRepo = inventoryRepo; ConfigRepo = configRepo; SignalRHubContext = hubContext; UserDomain = userDomain; TransactionScopeFactory = transactionScopeFactory; }
public ItemUseDomain(IInventoryRepository inventoryRepo, IConfigRepository configRepo, UserDomain userDomain, PetDomain petDomain, ITransactionScopeFactory transactionScopeFactory) { InventoryRepo = inventoryRepo; ConfigRepo = configRepo; UserDomain = userDomain; PetDomain = petDomain; TransactionScopeFactory = transactionScopeFactory; }
public UsersRepository( YastahDbContext context, ILogger <UsersRepository> logger, ITransactionScopeFactory transactionScopeFactory) { _context = context; _logger = logger; _transactionScopeFactory = transactionScopeFactory; }
public CommandHandlerActor(CommandExecutionStrategy commandExecutionStrategy, Type commandHandlerType, IServiceScopeFactory serviceScopeFactory, ITransactionScopeFactory transactionScopeFactory) { _commandExecutionStrategy = commandExecutionStrategy; _commandHandlerType = commandHandlerType; _serviceScopeFactory = serviceScopeFactory; _transactionScopeFactory = transactionScopeFactory; ReceiveAsync <Command>(Handle); }
public EventDomain(UserDomain userDomain, IHubContext <NotificationHub, IUserClient> hubContext, IRandomEventRepository randomEvents, InventoryDomain inventoryDomain, ITransactionScopeFactory transactionScopeFactory) { UserDomain = userDomain; HubContext = hubContext; RandomEvents = randomEvents; InventoryDomain = inventoryDomain; TransactionScopeFactory = transactionScopeFactory; }
public CharacterGuildsRepository( YastahDbContext context, ILogger <CharacterGuildsRepository> logger, ITransactionScopeFactory transactionScopeFactory) { _context = context; _logger = logger; _transactionScopeFactory = transactionScopeFactory; }
public BetScreenshotProcessor(ITransactionScopeFactory transactionScopeFactory, IUnitOfWorkScopeFactory unitOfWorkScopeFactory, IRepository<BetScreenshot> repositoryOfBetScreenshot, IRepository<Bet> repositoryOfBet, IScreenshotMakerFactory screenshotMakerFactory, IScreenshotAmazonS3Putter screenshotAmazonS3Putter, IBetScreenshotPathService betScreenshotPathService) { _transactionScopeFactory = transactionScopeFactory; _unitOfWorkScopeFactory = unitOfWorkScopeFactory; _repositoryOfBetScreenshot = repositoryOfBetScreenshot; _repositoryOfBet = repositoryOfBet; _screenshotMakerFactory = screenshotMakerFactory; _screenshotAmazonS3Putter = screenshotAmazonS3Putter; _betScreenshotPathService = betScreenshotPathService; }
public DeleteDocumentAssetCommandHandler( CofoundryDbContext dbContext, ICommandExecutor commandExecutor, ITransactionScopeFactory transactionScopeFactory ) { _dbContext = dbContext; _commandExecutor = commandExecutor; _transactionScopeFactory = transactionScopeFactory; }
public DocumentAssetCommandHelper( CofoundryDbContext dbContext, IFileStoreService fileStoreService, ITransactionScopeFactory transactionScopeFactory ) { _dbContext = dbContext; _fileStoreService = fileStoreService; _transactionScopeFactory = transactionScopeFactory; }
public RepostUserEventHandler( ITransactionScopeFactory transactionScopeFactory, IBackgroundJobService jobService, ILogger <RepostUserEventHandler> logger, IMessageBroker messageBroker) { _transactionScopeFactory = transactionScopeFactory; _jobService = jobService; _logger = logger; _messageBroker = messageBroker; }
public ShopDomain(IShopRepository shopRepo, IInventoryRepository inventoryRepo, IConfigRepository configRepo, UserDomain userDomain, InventoryDomain inventoryDomain, ITransactionScopeFactory transactionScopeFactory) { InventoryRepo = inventoryRepo; ShopRepo = shopRepo; ConfigRepo = configRepo; UserDomain = userDomain; InventoryDomain = inventoryDomain; TransactionScopeFactory = transactionScopeFactory; }
public UserMessageQueryHandler( ITransactionScopeFactory transactionScopeFactory, IAuthenticatedUserProvider authenticatedUserProvider, IVkWallService vkClient ) { _transactionScopeFactory = transactionScopeFactory; _authenticatedUserProvider = authenticatedUserProvider; _vkClient = vkClient; }
public MessageProcessor( IActiveMqMessageMapper activeMqMessageMapper, ISessionFactory sessionFactory, IActiveMqPurger purger, ITransactionScopeFactory transactionScopeFactory) { this.activeMqMessageMapper = activeMqMessageMapper; this.sessionFactory = sessionFactory; this.purger = purger; this.transactionScopeFactory = transactionScopeFactory; }
public BattlesService(ITransactionScopeFactory transactionScopeFactory, IUnitOfWorkScopeFactory unitOfWorkScopeFactory, IRepository<Battle> repositoryOfBattle, IRepository<Team> repositoryOfTeam, IRepository<Bet> repositoryOfBet, IRepository<BetScreenshot> repositoryOfBetScreenshot, IRepository<TeamBattleStatistics> repositoryOfTeamBattleStatistics, IRepository<TeamStatistics> repositoryOfTeamStatistics) { _transactionScopeFactory = transactionScopeFactory; _repositoryOfBattle = repositoryOfBattle; _repositoryOfTeam = repositoryOfTeam; _repositoryOfBet = repositoryOfBet; _repositoryOfBetScreenshot = repositoryOfBetScreenshot; _repositoryOfTeamBattleStatistics = repositoryOfTeamBattleStatistics; _repositoryOfTeamStatistics = repositoryOfTeamStatistics; _unitOfWorkScopeFactory = unitOfWorkScopeFactory; }
public DeleteWebDirectoryCommandHandler( CofoundryDbContext dbContext, IWebDirectoryCache cache, ICommandExecutor commandExecutor, ITransactionScopeFactory transactionScopeFactory ) { _dbContext = dbContext; _cache = cache; _commandExecutor = commandExecutor; _transactionScopeFactory = transactionScopeFactory; }
public DeleteImageAssetCommandHandler( CofoundryDbContext dbContext, IImageAssetCache imageAssetCache, ICommandExecutor commandExecutor, ITransactionScopeFactory transactionScopeFactory ) { _dbContext = dbContext; _imageAssetCache = imageAssetCache; _commandExecutor = commandExecutor; _transactionScopeFactory = transactionScopeFactory; }
public DeleteDocumentAssetCommandHandler( CofoundryDbContext dbContext, ICommandExecutor commandExecutor, ITransactionScopeFactory transactionScopeFactory, IMessageAggregator messageAggregator ) { _dbContext = dbContext; _commandExecutor = commandExecutor; _transactionScopeFactory = transactionScopeFactory; _messageAggregator = messageAggregator; }
public VkMessageService( IElasticClientFactory elasticClientFactory, ITransactionScopeFactory transactionScopeFactory, MessagePredicting.MessagePredictingClient messagePredictingClient, ILogger <VkMessageService> logger ) { _elasticClientFactory = elasticClientFactory; _transactionScopeFactory = transactionScopeFactory; _messagePredictingClient = messagePredictingClient; _logger = logger; }
public AccountCreator(IAccountService accountService, ITransactionScopeFactory transactionScopeFactory) { if (accountService == null) { throw new ArgumentNullException(nameof(accountService)); } if (transactionScopeFactory == null) { throw new ArgumentNullException(nameof(transactionScopeFactory)); } _accountService = accountService; _transactionScopeFactory = transactionScopeFactory; }
public CharacterGuildsService( IAuditableActionsRepository auditableActionsRepository, ICharacterGuildsRepository characterGuildsRepository, ILogger <CharacterGuildsService> logger, ISystemClock systemClock, ITransactionScopeFactory transactionScopeFactory) { _auditableActionsRepository = auditableActionsRepository; _characterGuildsRepository = characterGuildsRepository; _logger = logger; _systemClock = systemClock; _transactionScopeFactory = transactionScopeFactory; }
public UpdateDocumentAssetCommandHandler( CofoundryDbContext dbContext, EntityAuditHelper entityAuditHelper, EntityTagHelper entityTagHelper, DocumentAssetCommandHelper documentAssetCommandHelper, ITransactionScopeFactory transactionScopeFactory ) { _dbContext = dbContext; _entityAuditHelper = entityAuditHelper; _entityTagHelper = entityTagHelper; _documentAssetCommandHelper = documentAssetCommandHelper; _transactionScopeFactory = transactionScopeFactory; }
public GameRepository(IAsyncDbConnectionFactory connectionFactory, ITransactionScopeFactory transactionScopeFactory) { if (connectionFactory == null) { throw new ArgumentNullException("connectionFactory"); } if (transactionScopeFactory == null) { throw new ArgumentNullException("transactionScopeFactory"); } _connectionFactory = connectionFactory; _transactionScopeFactory = transactionScopeFactory; this.gameEventMapper = new GameEventMapper(); }
public DefaultConfigurator TransactionScopeFactory(ITransactionScopeFactory transactionScopeFactory) { Guard.AgainstNull(transactionScopeFactory, "transactionScopeFactory"); _configuration.TransactionScopeFactory = transactionScopeFactory; return this; }
public ServiceBusConfigurator TransactionScopeFactory(ITransactionScopeFactory transactionScopeFactory) { Guard.AgainstNull(transactionScopeFactory, "transactionScopeFactory"); configuration.TransactionScopeFactory = transactionScopeFactory; return this; }