/// <summary> /// Validates the add role claim command. /// </summary> /// <param name="value">The value.</param> /// <returns>IList<ValidatorMessage>.</returns> protected override IList <ValidatorMessage> ValidateRoleCommand(RoleCommand value) { var messages = new List <ValidatorMessage>(); if (!(value is RemoveRole)) { messages.Add(TypeMismatchError <RemoveRole>(value)); } return(messages); }
/// <summary> /// Validates the add role claim command. /// </summary> /// <param name="value">The value.</param> /// <returns>IList<ValidatorMessage>.</returns> protected override IList <ValidatorMessage> ValidateRoleCommand(RoleCommand value) { var messages = new List <ValidatorMessage>(); if (value is AddUserToRole command) { messages.AddRange(new RoleUserIdValidator(InstanceName, nameof(AddUserToRole.RoleUserId)).Validate(command.RoleUserId)); } else { messages.Add(TypeMismatchError <AddUserToRole>(value)); } return(messages); }
/// <summary> /// Validates the role command. /// </summary> /// <param name="value">The value.</param> /// <returns>System.Collections.Generic.IList<ExtenFlow.Infrastructure.ValidatorMessage>.</returns> protected override IList <ValidatorMessage> ValidateRoleCommand(RoleCommand value) { var messages = new List <ValidatorMessage>(); if (value is RemoveRoleClaim command) { messages.AddRange(new RoleClaimTypeValidator(InstanceName, nameof(RemoveRoleClaim.ClaimType)).Validate(command.ClaimType)); messages.AddRange(new RoleClaimValueValidator(InstanceName, nameof(RemoveRoleClaim.ClaimValue)).Validate(command.ClaimValue)); } else { messages.Add(TypeMismatchError <RemoveRoleClaim>(value)); } return(messages); }
/// <summary> /// Validates the role command. /// </summary> /// <param name="value">The value.</param> /// <returns>IList<ValidatorMessage>.</returns> protected override IList <ValidatorMessage> ValidateRoleCommand(RoleCommand value) { var messages = new List <ValidatorMessage>(); if (value is RenameRole command) { messages.AddRange(new RoleNameValidator(InstanceName, nameof(RenameRole.Name)).Validate(command.Name)); messages.AddRange(new RoleNormalizedNameValidator(InstanceName, nameof(RenameRole.NormalizedName)).Validate(command.NormalizedName)); } else { messages.Add(TypeMismatchError <RenameRole>(value)); } return(messages); }
/// <summary> /// Validates the role command. /// </summary> /// <param name="command">The command.</param> /// <returns>IList<ValidatorMessage>.</returns> protected virtual IList <ValidatorMessage> ValidateRoleCommand(RoleCommand command) => new List <ValidatorMessage>();