May 2018
Intermediate to advanced
334 pages
7h 25m
English
It is self-explanatory from the name validations that they are nothing but validators of user/client inputs. The user input can be validated at the client end or at the API end (server side). In RESTful services, you can validate the input using model validations with the help of data annotations.
If the model is validated, this does not guarantee that data that comes with the request is safe.
In this section, we will rewrite our model used in the code example of the previous section.
Here is the modified ProductViewModel code:
public class ProductViewModel{ public Guid ProductId { get; set; } [Required] public string ProductName { get; set; } [Required] public string ProductDescription { get; set; } public string ProductImage ...