Beispiel #1
0
 public static void ValidateFirstName(this UserCommandInputsFields command)
 {
     command.AddNotifications(new Contract()
                              .IsNotNullOrEmpty(command.FirstName, "FirstName", "First name is required")
                              .HasMinLen(command.FirstName, 2, "FirstName", "Firstname must have between 2 and 60 characters.")
                              .HasMaxLen(command.FirstName, 60, "FirstName", "Firstname must have between 2 and 60 characters."));
 }
Beispiel #2
0
 public static void ValidateEmail(this UserCommandInputsFields command)
 {
     command.AddNotifications(new Contract()
                              .IsNotNullOrEmpty(command.Email, "Email", "Email is required")
                              .IsEmail(command.Email, "Email", "Email is invalid."));
 }