2 using System.ComponentModel.DataAnnotations;
5 namespace CPE.App.Api.Models
7 // Models used as parameters to AccountController actions.
9 public class AddExternalLoginBindingModel
12 [Display(Name = "External access token")]
13 public string ExternalAccessToken { get; set; }
16 public class ChangePasswordBindingModel
19 [DataType(DataType.Password)]
20 [Display(Name = "Current password")]
21 public string OldPassword { get; set; }
24 [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
25 [DataType(DataType.Password)]
26 [Display(Name = "New password")]
27 public string NewPassword { get; set; }
29 [DataType(DataType.Password)]
30 [Display(Name = "Confirm new password")]
31 [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
32 public string ConfirmPassword { get; set; }
35 public class RegisterBindingModel
38 [Display(Name = "Email")]
39 public string Email { get; set; }
42 [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
43 [DataType(DataType.Password)]
44 [Display(Name = "Password")]
45 public string Password { get; set; }
47 [DataType(DataType.Password)]
48 [Display(Name = "Confirm password")]
49 [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
50 public string ConfirmPassword { get; set; }
53 public class RegisterExternalBindingModel
56 [Display(Name = "Email")]
57 public string Email { get; set; }
60 public class RemoveLoginBindingModel
63 [Display(Name = "Login provider")]
64 public string LoginProvider { get; set; }
67 [Display(Name = "Provider key")]
68 public string ProviderKey { get; set; }
71 public class SetPasswordBindingModel
74 [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
75 [DataType(DataType.Password)]
76 [Display(Name = "New password")]
77 public string NewPassword { get; set; }
79 [DataType(DataType.Password)]
80 [Display(Name = "Confirm new password")]
81 [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
82 public string ConfirmPassword { get; set; }