Skip to Content
Building RESTful Web Services with .NET Core
book

Building RESTful Web Services with .NET Core

by Gaurav Aroraa, Tadit Dash
May 2018
Intermediate to advanced
334 pages
7h 25m
English
Packt Publishing
Content preview from Building RESTful Web Services with .NET Core

Validations

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RESTful Web Services with ASP.NET Core 3

Hands-On RESTful Web Services with ASP.NET Core 3

Samuele Resca
Microservices in .NET Core

Microservices in .NET Core

Christian Horsdal Gammelgaard

Publisher Resources

ISBN: 9781788291576Supplemental Content