When we are using EF
(f.e.) via MVC
, we can use ModelState.IsValid
to detect a model
can pass DataAnnotations
metadata or not. But how can I use DataAnnotations
metadata in a desktop (win-forms / wpf) application?
More:
In fact, I want to create an object same as ModelState
(a dictionary that can save properties and messages associated with each). Then, wrap the DAL
by a validation-layer
, in VL
use metadata to validate models, that the VL
can be used in any project. I know I should use reflector, but I haven't any experience. Thanks to any help and suggestion.