public ITransitionBuilder <TState, TInput> WithPrecondition(
            ConnectorKey connectorKey,
            System.Action <IPreconditionBuilder> guard = null)
        {
            var preconditionBuilder = new PreconditionBuilder(connectorKey);

            guard?.Invoke(preconditionBuilder);

            Procondition = preconditionBuilder;

            return(this);
        }
Beispiel #2
0
        public IStateBuilder <TState, TInput> WithPrecondition(ConnectorKey connectorKey, System.Action <IPreconditionBuilder> precondition = null)
        {
            if (connectorKey == null)
            {
                throw new ArgumentNullException(nameof(connectorKey));
            }
            if (string.IsNullOrWhiteSpace(connectorKey.Identifier))
            {
                throw new ArgumentException("ConnectorKey must have a valid value", nameof(connectorKey));
            }

            var preconditionBuilder = new PreconditionBuilder(connectorKey);

            precondition?.Invoke(preconditionBuilder);

            Precondition = preconditionBuilder;

            return(this);
        }