AccountViewModels.cs
1,445 bytes
| 1 | using System.ComponentModel.DataAnnotations; |
|---|---|
| 2 | |
| 3 | namespace SplitApp.WebApp.Models.Account; |
| 4 | |
| 5 | public class LoginViewModel |
| 6 | { |
| 7 | [Required, EmailAddress, Display(Name = "Email")] |
| 8 | public string Email { get; set; } = ""; |
| 9 | |
| 10 | [Required, DataType(DataType.Password), Display(Name = "Password")] |
| 11 | public string Password { get; set; } = ""; |
| 12 | |
| 13 | public string? ReturnUrl { get; set; } |
| 14 | } |
| 15 | |
| 16 | public class RegisterViewModel |
| 17 | { |
| 18 | [Required, StringLength(128), Display(Name = "First Name")] |
| 19 | public string FirstName { get; set; } = ""; |
| 20 | |
| 21 | [Required, StringLength(128), Display(Name = "Last Name")] |
| 22 | public string LastName { get; set; } = ""; |
| 23 | |
| 24 | [Required, EmailAddress, Display(Name = "Email")] |
| 25 | public string Email { get; set; } = ""; |
| 26 | |
| 27 | [Required, StringLength(100, MinimumLength = 6), DataType(DataType.Password), Display(Name = "Password")] |
| 28 | public string Password { get; set; } = ""; |
| 29 | |
| 30 | [DataType(DataType.Password), Display(Name = "Confirm password")] |
| 31 | [Compare(nameof(Password), ErrorMessage = "The password and confirmation password do not match.")] |
| 32 | public string ConfirmPassword { get; set; } = ""; |
| 33 | |
| 34 | public string? ReturnUrl { get; set; } |
| 35 | } |
| 36 | |
| 37 | public class ManageViewModel |
| 38 | { |
| 39 | [Display(Name = "Email")] |
| 40 | public string Email { get; set; } = ""; |
| 41 | |
| 42 | [Display(Name = "First Name")] |
| 43 | public string FirstName { get; set; } = ""; |
| 44 | |
| 45 | [Display(Name = "Last Name")] |
| 46 | public string LastName { get; set; } = ""; |
| 47 | } |
| 48 | |