The validation rule in the `ReadOutResQueryValidator` class was updated to include a `WithName("Identifier")` call. This assigns a name ("Identifier") to the rule, improving the clarity and usability of validation error messages, especially in scenarios where multiple rules are applied and need to be distinguished.
14 lines
413 B
C#
14 lines
413 B
C#
using FluentValidation;
|
|
|
|
namespace ReC.Application.OutResults.Queries;
|
|
|
|
public class ReadOutResQueryValidator : AbstractValidator<ReadOutResQuery>
|
|
{
|
|
public ReadOutResQueryValidator()
|
|
{
|
|
RuleFor(x => x)
|
|
.Must(x => x.ActionId.HasValue || x.ProfileId.HasValue)
|
|
.WithMessage("At least one of ActionId or ProfileId must be provided.")
|
|
.WithName("Identifier");
|
|
}
|
|
} |