From da6d19225403bf7ce9b1446cae616a37ba7b1192 Mon Sep 17 00:00:00 2001 From: postb99 Date: Mon, 26 Jan 2026 21:56:45 +0100 Subject: [PATCH] Enable data annotations. Everything works --- Models/ViewModels/UserRegister.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Models/ViewModels/UserRegister.cs b/Models/ViewModels/UserRegister.cs index ca10717..e1a4224 100644 --- a/Models/ViewModels/UserRegister.cs +++ b/Models/ViewModels/UserRegister.cs @@ -1,10 +1,12 @@ -namespace Sandbox.Models.ViewModels; +using System.ComponentModel.DataAnnotations; + +namespace Sandbox.Models.ViewModels; public class UserRegister { public string Email { get; set; } = string.Empty; - //[Required, StringLength(100, MinimumLength = 5)] + [Required, StringLength(100, MinimumLength = 5)] public string Password { get; set; } = string.Empty; - //[Compare("Password", ErrorMessage = "The password do not match.")] + [Compare("Password", ErrorMessage = "The password do not match.")] public string ConfirmPassword { get; set; } = string.Empty; } \ No newline at end of file