What's the best way to validate EntityFramwork 4.0 classes?
- by lsb
Hi! I've done a fair amount of searching but I've yet to find an easy way to validate EntityFramework 4.0 entities passed accross the wire via WCF Data Services. Basically, I want to do something on the client like:
Proxy.MyEntities entities = new Proxy.MyEntities(
new Uri("http://localhost:2679/Service.svc"));
Proxy.Vendor vendor = new Proxy.Vendor();
vendor.Code = "ABC/XYZ";
vendor.Status = "ACTIVE";
// I'd like to do something like the following:
vendor.Validate();
entities.AddToVendors(vendor);
entities.SaveChanges();
Any help in this regard would be greatly appreciated!