Пример #1
0
        private void ValidateData(User user)
        {
            Requirement.MinLength(2, user.FirstName, "FirstName");
            Requirement.MaxLength(50, user.FirstName, "FirstName");

            Requirement.MinLength(2, user.LastName, "LastName");
            Requirement.MaxLength(50, user.LastName, "LastName");

            Requirement.MinLength(2, user.Address, "Address");
            Requirement.MaxLength(50, user.Address, "Address");

            Requirement.Email(user.Email, "Email");

            Requirement.DanishPhoneNumber(user.PhoneNumber, "PhoneNumber");

            Requirement.MinLength(8, user.Password, "Password");
            user.Password = Cryptography.Encrypt(user.Password);
        }