static public bool Validate(object it, out ValidatingExceptionMessage exceptionMessage) { bool rlt = Exec <IDataTransaction>(it, TFuncHandler <ValidatingExceptionMessage> .OnValidate, true); exceptionMessage = TFuncHandler <ValidatingExceptionMessage> .TempValue; return(rlt); }
private bool DoValidate(object value, out ValidatingExceptionMessage exceptionMessage) { exceptionMessage = null; if (DataTransactionHelper.IsDataTransactionObject(value)) { return(DataTransactionHelper.Validate(value, out exceptionMessage)); } IDataOwner dataOwner = PropertyOwner as IDataOwner; bool isPass = (dataOwner != null) ? dataOwner.Validate(value) : (CustomAttribute.IsRequired) ? Validate(value) : true; if (!isPass) { exceptionMessage = new ValidatingExceptionMessage(); exceptionMessage.Reference = PropertyOwner; exceptionMessage.ReferenceProperty = this; } return(isPass); }
public bool Validate(out ValidatingExceptionMessage exceptionMessage) { return(DoValidate(CurrentData, out exceptionMessage)); }