Пример #1
0
        /// <summary>
        /// Validates the add client claim command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>IList&lt;ValidatorMessage&gt;.</returns>
        protected override IList <ValidatorMessage> ValidateClientCommand(ClientCommand value)
        {
            var messages = new List <ValidatorMessage>();

            if (!(value is RemoveClient))
            {
                messages.Add(TypeMismatchError <RemoveClient>(value));
            }
            return(messages);
        }
Пример #2
0
        /// <summary>
        /// Validates the client command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>IList&lt;ValidatorMessage&gt;.</returns>
        protected override IList <ValidatorMessage> ValidateClientCommand(ClientCommand value)
        {
            var messages = new List <ValidatorMessage>();

            if (value is AddNewClient command)
            {
                messages.AddRange(new ClientNameValidator(InstanceName, nameof(AddNewClient.Name)).Validate(command.Name));
                messages.AddRange(new ClientNormalizedNameValidator(InstanceName, nameof(AddNewClient.Description)).Validate(command.Description));
            }
            else
            {
                messages.Add(TypeMismatchError <AddNewClient>(value));
            }
            return(messages);
        }
        /// <summary>
        /// Validates the client command.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>System.Collections.Generic.IList&lt;ExtenFlow.Infrastructure.ValidatorMessage&gt;.</returns>
        protected override IList <ValidatorMessage> ValidateClientCommand(ClientCommand value)
        {
            var messages = new List <ValidatorMessage>();

            if (value is RemoveClientClaim command)
            {
                messages.AddRange(new ClientClaimTypeValidator(InstanceName, nameof(RemoveClientClaim.ClaimType)).Validate(command.ClaimType));
                messages.AddRange(new ClientClaimValueValidator(InstanceName, nameof(RemoveClientClaim.ClaimValue)).Validate(command.ClaimValue));
            }
            else
            {
                messages.Add(TypeMismatchError <RemoveClientClaim>(value));
            }
            return(messages);
        }
Пример #4
0
 /// <summary>
 /// Validates the client command.
 /// </summary>
 /// <param name="command">The command.</param>
 /// <returns>IList&lt;ValidatorMessage&gt;.</returns>
 protected virtual IList <ValidatorMessage> ValidateClientCommand(ClientCommand command)
 => new List <ValidatorMessage>();