Error!
Success!

Sharing validation code between a WPF client, a WCF Service and Entit

0
kicks

Sharing validation code between a WPF client, a WCF Service and Entit  (Unpublished)

Recently Entity Framework 4.1 was released. 4.1 contains a DBContext class, which is largely a wrapper around the ObjectContext class with a simplified API. Now you might think as I did: “But if I’m comfortable with the ObjectContext class and I don’t use code first, why in the world would I need a DbContext?”. The answer is pretty simple. The DbContext has a feature which simply isn’t supported by the ObjectContext: data validation with the attributes from the System.ComponentModel.DataAnnotations namespace. In this article I’ll show you how to decorate your classes with validation attributes and how these classes can be reused by both the client and the server.


Kicked By:
Drop Kicked By: