mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
20 lines
510 B
C#
20 lines
510 B
C#
using CleanArchitecture.Domain.Errors;
|
|
using FluentValidation;
|
|
|
|
namespace CleanArchitecture.Domain.Commands.Users.DeleteUser;
|
|
|
|
public sealed class DeleteUserCommandValidation : AbstractValidator<DeleteUserCommand>
|
|
{
|
|
public DeleteUserCommandValidation()
|
|
{
|
|
AddRuleForId();
|
|
}
|
|
|
|
private void AddRuleForId()
|
|
{
|
|
RuleFor(cmd => cmd.UserId)
|
|
.NotEmpty()
|
|
.WithErrorCode(DomainErrorCodes.User.EmptyId)
|
|
.WithMessage("User id may not be empty");
|
|
}
|
|
} |