Пример #1
0
        public void Handle(ProjectionManagementMessage.Command.GetQuery message)
        {
            _lastAccessed = _timeProvider.Now;
            if (!ProjectionManagementMessage.RunAs.ValidateRunAs(Mode, ReadWrite.Read, _runAs, message))
            {
                return;
            }

            var emitEnabled = _persistedState.EmitEnabled ?? false;

            var projectionOutputConfig = new ProjectionOutputConfig
            {
                ResultStreamName =
                    _persistedState.SourceDefinition == null
                        ? ""
                        : new ProjectionNamesBuilder(_name, _persistedState.SourceDefinition).GetResultStreamName()
            };

            message.Envelope.ReplyWith(
                new ProjectionManagementMessage.ProjectionQuery(
                    _name,
                    Query,
                    emitEnabled,
                    _persistedState.SourceDefinition,
                    projectionOutputConfig));
        }
 public ProjectionQuery(string name, string query, bool emitEnabled, ProjectionSourceDefinition definition, ProjectionOutputConfig outputConfig)
 {
     _name         = name;
     _query        = query;
     _emitEnabled  = emitEnabled;
     _definition   = definition;
     _outputConfig = outputConfig;
 }
 public ProjectionQuery(
     string name,
     string query,
     bool emitEnabled,
     string projectionType,
     bool?trackEmittedStreams,
     bool?checkpointsEnabled,
     ProjectionSourceDefinition definition,
     ProjectionOutputConfig outputConfig)
 {
     _name                = name;
     _query               = query;
     _emitEnabled         = emitEnabled;
     _projectionType      = projectionType;
     _trackEmittedStreams = trackEmittedStreams;
     _checkpointsEnabled  = checkpointsEnabled;
     _definition          = definition;
     _outputConfig        = outputConfig;
 }
        public void Handle(ProjectionManagementMessage.Command.GetQuery message)
        {
            _lastAccessed = _timeProvider.Now;

            var emitEnabled = PersistedProjectionState.EmitEnabled ?? false;

            var projectionOutputConfig = new ProjectionOutputConfig
            {
                ResultStreamName =
                    PersistedProjectionState.SourceDefinition == null
                        ? ""
                        : new ProjectionNamesBuilder(_name, PersistedProjectionState.SourceDefinition).GetResultStreamName()
            };

            message.Envelope.ReplyWith(
                new ProjectionManagementMessage.ProjectionQuery(
                    _name,
                    Query,
                    emitEnabled,
                    PersistedProjectionState.SourceDefinition,
                    projectionOutputConfig));
        }