public void BirthDayValidation(ValidationArgs args)
        {
            var birthDay = (DateTime)args.Value;
            var isValid  = birthDay.AddYears(21) <= DateTime.Today;

            args.SetError(isValid, "Sorry, you're too young!");
        }
        public void UserNameValidation(ValidationArgs args)
        {
            var name    = (string)args.Value;
            var isValid = name != "UserName";

            args.SetError(isValid, "A user with this name is already registered!");
        }
        public void AgeValidation(ValidationArgs args)
        {
            var age     = (decimal)args.Value;
            var isValid = age >= 21;

            args.SetError(isValid, "Sorry, you're too young!");
        }