Hi there,
I have finally managed to start migrating to 2.0, every thing went really smooth! i still have a problem with validation...
i created a base Validator that looks like this
Public Class BFValidatorBase
Inherits ValidatorBase
....
End Class
This class has some validation-routines that apply to a large number of entities.
For a number of entitities i created specialized validators
Public Class ValidatorAuftrag
Inherits BFValidatorBase
Public Overrides Sub ValidateEntityBeforeSave(ByVal involvedEntity As IEntityCore)
End Sub
Public Overrides Sub ValidateEntity(ByVal involvedEntity As IEntityCore)
End Sub
End Class
I also have a generalised validation routine on my BL
Public Function Validate(ByVal Entity As EntityBase2) As ORMEntityValidationException Implements IBusinessFacade.Validate
Me.SetValidator(Entity, True)
Try
Entity.ValidateEntity()
Entity.Validator.ValidateEntity(Entity)
Catch ex As ApplicationException
Return ex
End Try
End Function
SetValidator finds the proper validator for an entity and sets it through the accessor Entity.Validator.
The problem is: calling Entity.ValidateEntity() dosen't result in the proper method in the validator being fired. I have to call Entity.Validator.ValidateEntity(Entity). What is really irritiating is that ValidateEntityBeforeSave is being called the way it should be!
What am i doing wrong here?
another issue is the implementation of IDataErrorInfo. Until now i had been collecting error-messages and displaying by searching for the binding element on the form. I am using janus controls on my form, do i need to add extra code in order for these messages to appear for the controls?
Thank you very much in advance for your help