/// <summary> /// Indicates whether all of the property values of the object are valid /// </summary> /// <param name="errors">If the object is not valid then this list is populated with the errors</param> /// <returns>Returns true if all are valid </returns> public bool IsValid(out IList <IBOError> errors) { errors = new List <IBOError>(); if (IsDeleted) { return(true); } bool valid = _bo.Props.IsValid(out errors); foreach (BOError error in errors) { error.BusinessObject = this.BusinessObject; } IList <IBOError> customRuleErrors; valid &= _bo.AreCustomRulesValidInternal(out customRuleErrors); if (customRuleErrors != null) { foreach (BOError error in customRuleErrors) { error.BusinessObject = this.BusinessObject; errors.Add(error); } } string customRuleErrorsString; valid &= _bo.AreCustomRulesValidInternal(out customRuleErrorsString); if (!String.IsNullOrEmpty(customRuleErrorsString)) { BOError customError = new BOError(customRuleErrorsString, ErrorLevel.Error) { BusinessObject = this.BusinessObject }; errors.Add(customError); } return(valid); }