25 lines
476 B
C#
25 lines
476 B
C#
using FluentValidation;
|
|
using GerstITS.Validation;
|
|
|
|
namespace GerstITS.Examples.Logic.Customers.Validation;
|
|
|
|
internal sealed class CustomerValidationRule : ValidationRuleBase<Customer>
|
|
{
|
|
#region Constructors
|
|
|
|
public CustomerValidationRule()
|
|
{
|
|
RuleFor(x => x.FirstName)
|
|
.NotEmpty();
|
|
|
|
RuleFor(x => x.LastName)
|
|
.NotEmpty();
|
|
|
|
RuleFor(x => x.EMail)
|
|
.NotEmpty()
|
|
.IsEMail();
|
|
}
|
|
|
|
#endregion
|
|
}
|