mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
20 lines
535 B
C#
20 lines
535 B
C#
using CleanArchitecture.Domain.Errors;
|
|
using FluentValidation;
|
|
|
|
namespace CleanArchitecture.Domain.Commands.Tenants.DeleteTenant;
|
|
|
|
public sealed class DeleteTenantCommandValidation : AbstractValidator<DeleteTenantCommand>
|
|
{
|
|
public DeleteTenantCommandValidation()
|
|
{
|
|
AddRuleForId();
|
|
}
|
|
|
|
private void AddRuleForId()
|
|
{
|
|
RuleFor(cmd => cmd.AggregateId)
|
|
.NotEmpty()
|
|
.WithErrorCode(DomainErrorCodes.Tenant.TenantEmptyId)
|
|
.WithMessage("Tenant id may not be empty");
|
|
}
|
|
} |