For those who wonder, given the following ruleset for a TerminalId parameter:
<ValidatorComposition(CompositionType.And)> _
<NotNullValidator(MessageTemplate:="Terminal id is required.", Ruleset:="Default")> _
<StringLengthValidator(1, 19, MessageTemplate:="Terminal id must be between 1 and 19 digits in length.", Ruleset:="Default")> _
Public Property TerminalId() As String
Get
Return _TerminalId
End Get
Set(ByVal value As String)
_TerminalId = value
End Set
End Property
Simply adding an additional rule set identifier would do the trick.
<StringLengthValidator(1, 19, MessageTemplate:="Terminal id must be between 1 and 19 digits in length.", Ruleset:="Client1.Default")>
<StringLengthValidator(3, 10, MessageTemplate:="Terminal id must be between 3 and 10 digits in length.", Ruleset:="Client2.Default")>
<StringLengthValidator(5, 25, MessageTemplate:="Terminal id must be between 5 and 25 digits in length.", Ruleset:="Client3.Default")>
... then simply calling the appropriate validation rule set that matches the logged-in client.
Ah EntLib.