//Validate CountryName protected virtual ValidationResult ValidateCountryName(Int16 idCountry, string countryName) { ValidationResult validationResult = new ValidationResult(true); try { //Create Validator based on its Key name : 'Keywords.UpdateCountry'. //The validator factory will create the validator object based on its key. ICountryValidator validator = (ICountryValidator)ValidatorFactory.Create(Keywords.UpdateCountry); //Execute validation process validationResult = validator.ValidateCountryName(idCountry, countryName); } catch { //The program will throw error if the validation object doesn't exist. And the default of validation result is true. } return(validationResult); }