4

I've been searching all over trying to find a reasonable and working solution to this.

I've created a new Database using EF6.0 (VS 2013) using a Model First approach. This model was created in the WPF application that will utilize the database. I have been unable to successfully implement any type of data validation (I've done data annotations in ASP and EF, metadata classes etc), however, I've been unable to get my meta data classes to be utilized.

Does anyone have any straightforward write-up/article/blog/etc that has a firm and VALID example of how to use EF6 Data Validations to drive notifications to the UI in a WPF application? Any assistance would helpful, or perhaps, better advice on data validation. I could easily write custom validation logic to check the entity before attempting to persist to the database, but this seems counter intuitive to the idea of the Entity Framework and its built in validation attributes.

1 Answer 1

0

Are your mapping files created using Fluent API or data annotations?

Maybe you can implement IValidatbleObject interface, or you may use the FluentValid library.

Check this answer How do I use IValidatableObject?.

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.