summaryrefslogtreecommitdiff
path: root/Models
diff options
context:
space:
mode:
Diffstat (limited to 'Models')
-rw-r--r--Models/Author.cs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Models/Author.cs b/Models/Author.cs
index 23e8a64..fc5d103 100644
--- a/Models/Author.cs
+++ b/Models/Author.cs
@@ -10,6 +10,7 @@ namespace LibraryAPI.Models {
[StringLength(64, ErrorMessage = "Name too long")]
public string? Name { get; set; }
[Required]
+ [Range(0, 2020, ErrorMessage = "Year out of valid range")]
public int YearOfBirth { get; set; }
[Required]
public string[]? languages { get; set; }