public PossiblyOffStatus(IStreamStatusContext context, IQueryCommandService <IUnitOfWork> unitOfWork, ITimeService timeService, ISettings settings) { _context = context; _unitOfWork = unitOfWork; _timeService = timeService; _settings = settings; }
/// <summary> /// Executes the given commands in sequence and returns total number of objects written to the underlying database. /// </summary> /// <typeparam name="TContext"></typeparam> /// <param name="dbService">The instance of the interface on which this extension method is defined.</param> /// <param name="commands">The sequence of commands of execute.</param> /// <returns>The total number of objects written to the underlying database from all of the given <paramref name="commands"/>.</returns> public static int Command <TContext>(this IQueryCommandService <TContext> dbService, params Action <TContext>[] commands) where TContext : IDisposable, ISavable => dbService.Command(db => commands .Where(cmd => cmd != null) .Sum(cmd => { cmd(db); return(db.SaveChanges()); }));
public ModCommandRepositoryLogic( IQueryCommandService <IUnitOfWork> unitOfWork, ILogger logger ) { _unitOfWork = unitOfWork; _logger = logger; }
public QueryQueryService( IQueryCommandService queryCommandService, IAdministrationUnitOfWork unitOfWork, ILog log, IServiceAuthorizationPolicy authorizationPolicy, IServiceIdentityProvider identityProvider) : base(unitOfWork, log, authorizationPolicy, identityProvider) { _queryCommandService = queryCommandService; _inboundServiceProxy = new InboundServiceProxy(); }
public StreamStateServiceProvider( IQueryCommandService <IUnitOfWork> unitOfWork, ITimeService timeService, IDownloadMapper downloadMapper, ISettings settings ) { _unitOfWork = unitOfWork; _timeService = timeService; _downloadMapper = downloadMapper; _settings = settings; }
public QueryController(IUserQueryService userQueryService, IAgencyQueryService agencyQueryService, IQueryQueryService queriesQueryService, IQueryCommandService queriesCommandService) { _userQueryService = userQueryService; _agencyQueryService = agencyQueryService; _queriesQueryService = queriesQueryService; _queriesCommandService = queriesCommandService; //Get the Tenant Name from the setting in the web.config //TTMS expects a Tenant Name and RMS does not have the concept of a Tenant _tenantName = ConfigurationManager.AppSettings["TenantName"]; }
public PeriodicMessages( IQueryCommandService <IUnitOfWork> unitOfWork, IFactory <TimeSpan, Action, Task> periodicTaskFactory, ISettings settings, IPipelineManager pipelineManager, IFactory <string> latestYoutubeFactory ) { _periodicTaskFactory = periodicTaskFactory; _pipelineManager = pipelineManager; _latestYoutubeFactory = latestYoutubeFactory; _unitOfWork = unitOfWork; _settings = settings; }
public PeriodicTwitterStatusUpdater( IFactory <TimeSpan, Action, Task> periodicTaskFactory, IQueryCommandService <IUnitOfWork> unitOfWork, IPipelineManager pipelineManager, ITwitterManager twitterManager, ISettings settings ) { _periodicTaskFactory = periodicTaskFactory; _unitOfWork = unitOfWork; _pipelineManager = pipelineManager; _twitterManager = twitterManager; _settings = settings; }
public CivilianPublicMessageToSendablesFactory( IErrorableFactory <ISnapshot <Civilian, PublicMessage>, IReadOnlyList <ISendable <ITransmittable> > > punishmentFactory, IErrorableFactory <ISnapshot <IUser, IMessage>, IReadOnlyList <ISendable <ITransmittable> > > commandFactory, IQueryCommandService <IUnitOfWork> repository, ITimeService timeService, ISettings settings ) { _punishmentFactory = punishmentFactory; _commandFactory = commandFactory; _repository = repository; _timeService = timeService; _settings = settings; }
public TwitterManager( IPrivateConstants privateConstants, ILogger logger, ITwitterStreamingMessageObserver twitterObserver, IQueryCommandService <IUnitOfWork> unitOfWork, IFactory <Status, string, IEnumerable <string> > twitterStatusFormatter, ITimeService timeService ) { _privateConstants = privateConstants; _logger = logger; _twitterObserver = twitterObserver; _unitOfWork = unitOfWork; _twitterStatusFormatter = twitterStatusFormatter; _timeService = timeService; }
public StreamStateService( IQueryCommandService <IUnitOfWork> unitOfWork, ITimeService timeService, IDownloadMapper downloadMapper, ISettings settings ) { _unitOfWork = unitOfWork; _timeService = timeService; _downloadMapper = downloadMapper; _onStatus = new OnStatus(this); _offStatus = new OffStatus(this); _possiblyOffStatus = new PossiblyOffStatus(this, _unitOfWork, _timeService, settings); var initialStatus = unitOfWork.Query(u => u.StateIntegers.StreamStatus); _latestStreamOnTime = unitOfWork.Query(u => u.StateIntegers.LatestStreamOnTime); _latestStreamOffTime = unitOfWork.Query(u => u.StateIntegers.LatestStreamOffTime); switch (initialStatus) { case StreamStatus.On: _currentStatus = _onStatus; break; case StreamStatus.Off: _currentStatus = _offStatus; break; case StreamStatus.PossiblyOff: _currentStatus = _possiblyOffStatus; break; default: throw new NotSupportedException($"The stream status {initialStatus} is not registered"); } }
public ScopedQueryCommandServiceDecorator(IQueryCommandService <TContext> decoratedQueryCommandService, IScopeCreator lifetimeScoper) { this._decoratedQueryCommandService = decoratedQueryCommandService; this._lifetimeScoper = lifetimeScoper; }
public RepositoryInitializer(IQueryCommandService <IBotDbContext> queryCommandService) { _queryCommandService = queryCommandService; _databaseInitializer = new DatabaseInitializer(_queryCommandService); }
public RepositoryPunishmentFactory(IQueryCommandService <IUnitOfWork> unitOfWork, ILogger logger) { _unitOfWork = unitOfWork; _logger = logger; }
private static void AddMute(IModCommandRepositoryLogic modCommandLogic, string mutedPhrase, TimeSpan firstDuration, IQueryCommandService <IUnitOfWork> unitOfWork) { modCommandLogic.AddMute(mutedPhrase, firstDuration); var autoPunishments = unitOfWork.Query(u => u.AutoPunishments.GetAllWithUser); var autoPunishment = autoPunishments.Single(); Assert.AreEqual(mutedPhrase, autoPunishment.Term); Assert.AreEqual(AutoPunishmentType.MutedString, autoPunishment.Type); Assert.AreEqual(firstDuration, autoPunishment.Duration); }
public AegisPardonFactory(IModCommandRegex modCommandRegex, IFactory <IReceived <Moderator, IMessage>, Nuke> nukeFactory, IQueryCommandService <IUnitOfWork> unitOfWork, ISettings settings, ITimeService timeService) : base(settings, timeService) { _modCommandRegex = modCommandRegex; _nukeFactory = nukeFactory; _unitOfWork = unitOfWork; }
public CommandFactory(IQueryCommandService <IUnitOfWork> repository, ICommandLogic commandLogic) { _repository = repository; _commandLogic = commandLogic; }
public NukeMuteFactory(ISettings settings, ITimeService timeService, IQueryCommandService <IUnitOfWork> repository) : base(settings, timeService) { _settings = settings; _repository = repository; }
public DatabaseInitializer(IQueryCommandService <IBotDbContext> queryCommandService) { _queryCommandService = queryCommandService; }