/// <summary> /// Validates the add client claim command. /// </summary> /// <param name="value">The value.</param> /// <returns>IList<ValidatorMessage>.</returns> protected override IList <ValidatorMessage> ValidateClientCommand(ClientCommand value) { var messages = new List <ValidatorMessage>(); if (!(value is RemoveClient)) { messages.Add(TypeMismatchError <RemoveClient>(value)); } return(messages); }
/// <summary> /// Validates the client command. /// </summary> /// <param name="value">The value.</param> /// <returns>IList<ValidatorMessage>.</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<ExtenFlow.Infrastructure.ValidatorMessage>.</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); }
/// <summary> /// Validates the client command. /// </summary> /// <param name="command">The command.</param> /// <returns>IList<ValidatorMessage>.</returns> protected virtual IList <ValidatorMessage> ValidateClientCommand(ClientCommand command) => new List <ValidatorMessage>();