I have a date property that is nullable in the database but based on business logic may not be null in specific cases. To accomplish this I figured inheriting a class from PropertyValueVerifier would be the best way. The VerifyValue method is called when the date is changed to another date but does not get called when the date goes to null. Is this a bug or am I doing something wrong?
... return new NullEndDateVerifier( typeof(StatusRqst), EntityPropertyNames.EndDateTimeDt, null, true); ... public class NullEndDateVerifier : PropertyValueVerifier { public NullEndDateVerifier( Type a_entityType, string a_sPropertyName, string a_sDisplayName = null, bool? a_bShouldTreatEmptyStringAsNull = null) : base(new PropertyValueVerifierArgs(a_entityType, a_sPropertyName, false, a_sDisplayName, a_bShouldTreatEmptyStringAsNull)) { } public NullEndDateVerifier(PropertyValueVerifierArgs a_verifierArgs) : base(a_verifierArgs) { } protected override VerifierResult VerifyValue(object itemToVerify, object valueToVerify, TriggerContext triggerContext, VerifierContext verifierContext) { return new VerifierResult(true); } }
|
Thanks,
Steve