December 2019
Intermediate to advanced
598 pages
12h 21m
English
Let's add validation to the request for updating a question:
using System.ComponentModel.DataAnnotations;
public class QuestionPutRequest{ [StringLength(100)] public string Title { get; set; } public string Content { get; set; }}
We are making sure that a new title doesn't exceed 100 characters.

A validation error is returned as expected.
Read now
Unlock full access