BudgetAnalyser.Engine.Services.ApplicationDatabaseService.ValidateAll C# (CSharp) Method

ValidateAll() public method

public ValidateAll ( [ messages ) : bool
messages [
return bool
        public bool ValidateAll([NotNull] StringBuilder messages)
        {
            if (messages == null)
            {
                throw new ArgumentNullException(nameof(messages));
            }

            var valid = true;
            foreach (var service in this.databaseDependents) // Already sorted ascending by sequence number.
            {
                try
                {
                    valid = service.ValidateModel(messages);
                }
                catch (ValidationWarningException ex)
                {
                    messages.AppendLine(ex.Message);
                    valid = false;
                }
            }

            return valid;
        }