In the controller I would like to be able to get to the client validation rules of the model. I\'ve attached some attributes using data annotations and would like to be able
Depeneding on what you exactly need to do, Breeze js can be the best solution. particularly, if you're using EF, you can replicate most of the functionality of the server EF's DbContext
on the client side, including, of course, the validation, but also change tracking, .saveChanges
, a simple syntax that resembles LINQ queries, caching, serializing and deserializing to allow working offline, and many other things.
The basic steps to work with Breeze js are:
Of course, not all of the functionality on the server will be replicated on the client, but you can do a lot of things:
saveChanges
on the client side, which will transfer all the tracked changes to the server so that the backend is updated.saveChanges
Finally, you can extend and modify the server code to include some business logic, so that you can do much more than simply exposing the EF model to the client.