IDataErrorInfo, DbEntityValidationException, and propagating errors back to the UI RRS feed

  • Question

  • In our WPF app we are using IDataErrorInfo to display errors to the user, we are tying that into DbEntityValidationResult which we use on the SaveChanges for the DBContext. All is well with that process, we can tie back to the UI to show validation or save errors with the data that is currently being displayed. Our issue comes in when we have a screen which is essentially a parent-child relationship, and the error happens with a child of a not-currently-selected parent. We have no straightforward way of letting the user know which parent entity has a problem child. What we'd like to do is show some kind of error status flag on the parent entity in the UI, so the user knows that is the entity with the issue. We can't figure out an efficient way to propagate that error back up to the parent entity. We've looked at using rercursion across navigation properties, and that got ugly quickly. Is there a suggestion or pattern we could use to identify parent entities which have child errors?
    Wednesday, December 7, 2011 7:52 PM


All replies