The TriggerTargetNavigator represents a delegate for navigating from the trigger object to the object being verified. The navigator can either be a path (PropertyDescriptor) or a custom method capable of bridging the two object types.
Here’s an example taken from the sample app accompanying the Verification Tutorial videos on the website, where the navigator is a path:
///<summary>Get the OrderDateAfterHired Verifier.</summary>
private static Verifier GetOrderDateAfterHiredVerifier() {
string description = "OrderDate must be after the sales rep's HireDate.";
DelegateVerifier<Order> v =
new DelegateVerifier<Order>(description, OrderDateAfterHiredCondition);
v.ExecutionModes = VerifierExecutionModes.InstanceAndOnPostsetTriggers;
v.AddTrigger(EntityPropertyDescriptors.Order.OrderDate);
v.AddTrigger(new TriggerLink(
EntityPropertyDescriptors.Employee.HireDate, // Triggered by Employee.HireDate
EntityPropertyDescriptors.Employee.Orders, // Path from trigger (Employee) to Order
true)); // True = that path returns multiple orders
return v;
} |