This article is a mirror article of machine translation, please click here to jump to the original article.

View: 18938|Reply: 2

[WebAPI] webapi ModelState.IsValid model validation

[Copy link]
Posted on 6/26/2017 2:16:08 PM | | |
First, our webapi method

Our vehicle positioning information model is as follows:

We want to set the "CompanyId property is required." VehicleNo attribute is required. VehicleRegionCode property is required. ”

(End)




Previous:The SDK of the SMS service reports an exception: SDK.InvalidRegionId : Can not find endpoint to access.
Next:Verification of WebAPI Universal Signatures (2)
 Landlord| Posted on 6/26/2017 2:19:06 PM |
ASP. MVC ModelState.IsValid model validation pit

When the client initiates a request, there is no POST parameter at all, ModelState.isValid is True, and the model object is empty....

So you can't fully trust Modelstate.isValid here, using a model object, to do this...




 Landlord| Posted on 6/26/2017 2:35:47 PM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com