Esempio n. 1
0
        private static string Dump(ValidationResults results)
        {
            var buffer = new StringBuilder();

            results.ToList().ForEach(r => buffer.AppendLine("{0} => '{1}'".FormatWith(r.Key, r.Message)));
            return(buffer.ToString());
        }
Esempio n. 2
0
        public virtual void ExecuteValidation()
        {
            ValidationResults validationResults = this.GetErrors <T>();

            if (!validationResults.IsValid)
            {
                throw new CommonValidationException(validationResults.ToList <ValidationResult>());
            }
        }
Esempio n. 3
0
        void MergeValidationResults(CommandResult commandResultToMerge)
        {
            if (commandResultToMerge.ValidationResults == null)
            {
                return;
            }

            if (ValidationResults == null)
            {
                ValidationResults = commandResultToMerge.ValidationResults;
                return;
            }

            var validationResults = ValidationResults.ToList();

            validationResults.AddRange(commandResultToMerge.ValidationResults);
            ValidationResults = validationResults.ToArray();
        }