summaryrefslogtreecommitdiff
path: root/Models
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-09-20 20:34:32 -0500
committerHombreLaser <sebastian-440@live.com>2022-09-20 20:34:32 -0500
commitf20b0eec603e8951cf78ed119745a85fde521706 (patch)
treebef5e124a08be616713c07141d568767d938bc5d /Models
parentf4f9762085b9858eacd7906188841e06e20a893a (diff)
Añadido un validador para el autor
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; }