Esempio n. 1
0
        public void ValidateModel(TModel model)
        {
            RulesException.ErrorsForValidationResults(ValidateModelProperties(model));
            ValidateModelRules(model);

            RulesException.ThrowException();
        }
Esempio n. 2
0
        public void ValidateModel(TModel model)
        {
            ValidateModelPropertiesAndBuildRulesException(model);
            ValidateModelRules(model);

            RulesException.ThrowException();
        }
Esempio n. 3
0
        public async Task ValidateModelAsync(TModel model)
        {
            ValidateModelPropertiesAndBuildRulesException(model);
            await ValidateModelRulesAsync(model);

            RulesException.ThrowException();
        }
Esempio n. 4
0
        public async Task ValidateModelAsync(TModel model)
        {
            RulesException.ErrorsForValidationResults(ValidateModelProperties(model));
            await ValidateModelRulesAsync(model);

            RulesException.ThrowException();
        }
Esempio n. 5
0
            public void Validate(RulesBaseParams parameters)
            {
                ValidateModelPropertiesAndBuildRulesException(this);

                if (string.IsNullOrEmpty(Foo))
                {
                    RulesException.ErrorFor(x => x.Foo, "Please supply a Foo");
                }

                if (parameters.ThrowException)
                {
                    RulesException.ThrowException();
                }
            }