Yes, The parameter "c" is IConstraintValidatorContext
Gian Marco Gherardi
December 5, 2010 at 11:50 PM
Hi, looking at my code, i see that i use many of this validations:
ValidateInstance.By((x, c) => AssertThatAssociationHasMaxTwoSides:cross_mark:).WithMessage("an association can have two sides at most."); ValidateInstance.By((x, c) => AssertThatBidirectionalAssociationHasConsistentTypes:cross_mark:).WithMessage("the 2 sides of an association must have consistent types."); ValidateInstance.By((x, c) => AssertThatBidirectionalAssociationHasOneInverseSide:cross_mark:).WithMessage("a bidirectional association must have one inverse side."); ValidateInstance.By((x, c) => AssertThatNameIsUnique:cross_mark:).WithMessage("Field name must be unique in containing type."); ValidateInstance.By((x, c) => AssertThatIdIsUnique:cross_mark:).WithMessage("Field id must be unique in containing type."); ValidateInstance.By((x, c) => AssertThatTypeExists:cross_mark:).WithMessage("referenced Type does not exists.");
So i think that the feature i'm requesting is already there.
Fabio Maulo
December 5, 2010 at 7:46 AM
Which is the aggregate value ? In general, where you have invalid values, you have to add messages to the IConstraintValidatorContext
Should be really easy to add it