How do you test an object containing DataAnnotations without using the MVC library? Using Model.IsValid is great when you are at the presentation level, but what about when you want the model to be valid at the Domain / Business level? Do I need a separate verification system, or is there a simple way that I am missing?
Thanks for any help
Mark
, ModelState.IsValid Model.IsValid, ? , DataAnnotions MVC, IValidatableObject.
, , Validator class , Validator.ValidateObject(, ValidationContext).
, #, - , try catch -. , . , . [] ajax , , - , , , .
Source: https://habr.com/ru/post/1740180/More articles:ISAPI rewrite (using Helicon on IIS and ASP.NET) and add a dynamic query string? - regexwhy echo doesn't show anything while php is busy - phpText Image Detection - algorithmOpen the PDF file in an external application on the iPad. - cocoa-touchIs there a way to backup everything in the app-engine block block? - pythonWhat causes the NoMethodError: undefined method? Include? for nil: NilClass "- methodsAccess FlowScope from JSP without JSTL - javaModelAttributes options not available on jsp - javaSerial data set (e.g. VSAM) for Java - javaJavaFX Layout Question - listviewAll Articles