public class UpdateTodoListCommandValidator : AbstractValidator<UpdateTodoListCommand>
{
public UpdateTodoListCommandValidator()
{
RuleFor(v => v.Title)
.NotEmpty()
.MaximumLength(200);
}
}
public record UpdateTodoListCommand : IRequest<int>
{
public int Id { get; init; }
public string? Title { get; init; }
}
public class UpdateTodoListCommandHandler : IRequestHandler<UpdateTodoListCommand,int>
{
public async Task<int> Handle(UpdateTodoListCommand request, CancellationToken cancellationToken)
{
return 1;
}
}
`
but when we remove the Irequest Result (In this example (int)) Validation is not fired.
Kind regards and thanks for a fantastic free tool.
Hi In Dot Net SDK 8 MediatR 12.2
This code is working properly `
`
but when we remove the Irequest Result (In this example (int)) Validation is not fired.
Kind regards and thanks for a fantastic free tool.