I am using asp.net MVC3 with Enitity frameword. both are communicating via WCF web service.
the problem is that , at the server side DB developers don’t want to set the [Required]/[Range] attributes to property in there Entity classes. But i want to validate the field at my end in mvc3 application. where as i added the WCF webservice reference. which generated proxy.
I don’t want to use Jquery/javascript as per client policy. so i need to do it at my controller/Model level. how to manage this ? some how i need to add the required attribute to the properties of each entity dynamically from mvc 3 aaplication. need right direction to speed up.
Forgot to add: Db developer striclty avoiding to user required. also db not generated in entity and mappings.
You must write a code to validate your entities. Even if developers used those attributes on entities you would not have them on your side because you are accessing the DAL through WCF generated proxy and those attributes are not generated by the tool on your side.
All classes generated by add service reference should be partial so you can add your custom partial part and implement validation (by implementing
IValidatableObjectinterface).