O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DBcontext validation

Image

Data validation is a critical component of any data-centric application, so it may come as a surprise to discover that Entity Framework doesn’t provide a validation API. Instead, it depends on standard .NET techniques. If you’re using the ObjectContext API, that means handlng property changing events or extending the SaveChanges() method (or adding your own validation layer, which is pretty advanced stuff). The DbContext API, however, adds support for the IValidatableObject interface, which not only provides a powerful mechanism for validating entities, but integrates with other .NET technologies and tools. Here’s how DbContext ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required