예제 #1
0
        /// <summary>
        /// Validate this entity and collects/stores any validation errors
        /// into the results supplied and optionally copies the errors into the internal error state for this entity.
        /// </summary>
        /// <returns></returns>
        public virtual bool Validate(IValidationResults results, bool copyToInternalErrors)
        {
            if (!copyToInternalErrors)
            {
                return(Validate(results));
            }

            Validate();
            _validationResults.CopyTo(results);
            return(_validationResults.IsValid);
        }