Thread is closed for posting
2 posts, 0 answers
  1. Klaas
    Klaas avatar
    1 posts
    Member since:
    Sep 2012

    Posted 28 Nov 2013 Link to this post


    I was wondering why properties are tested when you "get" them instead of setting them when using the IDataErrorInfo interface ?

    Data from the database should always be correct so i think when you set a property to save it to the db it must then be tested and the otherway around ?

    Any info on this ?

    Best regards,


  2. Dimitar Tachev
    Dimitar Tachev avatar
    67 posts

    Posted 03 Dec 2013 Link to this post

    Hi Klaas,

    The IDataErrorInfo interface contains an Error property providing the current error message for the object and an indexer for validating a property by name most often used for a validation by the UI controls supporting this interface:
    public interface IDataErrorInfo
        string Error { get; }
        string this[string columnName] { get; }

    Regarding the issue that you have described - the code generated by Telerik OpenAccess ORM is validating the entities in the indexer and you should not have any validations in the getters of your properties.

    You could find more information about our IDataErrorInfo support in this blog post and the documentation article describing its recommended implementation. I also suggest you take a look at this blog post demonstrating how to use the interface in WPF applications.

    Could you please confirm that without applying any changes on our code generation templates you are getting the ValidatePropertyInternal method calls in the getters of your properties instead of in the indexer?

    I am looking forward to your feedback.

    Dimitar Tachev
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Back to Top