Model for the My Account page. This class is decorated with the Authorize attribute.
More...
Model for the My Account page. This class is decorated with the Authorize attribute.
◆ MyAccountModel()
| BetterFinds.Pages.MyAccountModel.MyAccountModel |
( |
IConfiguration |
configuration | ) |
|
Initializes a new instance of the MyAccountModel class.
- Parameters
-
| configuration | The IConfiguration instance. |
◆ OnGet()
| IActionResult BetterFinds.Pages.MyAccountModel.OnGet |
( |
| ) |
|
|
inline |
The action that occurs when the user visits the MyAccount page.
Gets the user's information from the database and displays it, as well as the number of auctions and bids they have. If the user got redirected from updating their account, displays a success message.
- Returns
- A task that represents the action of loading the MyAccount page.
◆ OnPost()
| IActionResult BetterFinds.Pages.MyAccountModel.OnPost |
( |
| ) |
|
|
inline |
Updates the user's information if all requirements are met.
-
Username must be unique and between 3 and 32 alphanumeric characters.
-
Full name must be between 3 and 64 alphabetic characters.
-
Email must unique and be between 5 and 320 characters.
-
Password must be between 8 and 64 characters.
-
Password and ConfirmPassword must match.
-
Profile picture must be 256 characters or fewer.
-
OptNewsletter is an optional checkbox.
If all requirements are met, the user's information is updated in the database and they are redirected to the MyAccount page with a success message.
- Returns
- A task that represents the action of updating the user's information.
◆ RegexFullName()
| static partial Regex BetterFinds.Pages.MyAccountModel.RegexFullName |
( |
| ) |
|
|
staticprivate |
Returns a regex that matches a full name.
A full name contains only alphabetical characters and spaces.
- Returns
- A regex that matches a full name.
◆ RegexUsername()
| static partial Regex BetterFinds.Pages.MyAccountModel.RegexUsername |
( |
| ) |
|
|
staticprivate |
Returns a regex that matches a username.
A username contains only alphanumeric characters.
- Returns
- A regex that matches a username.
◆ configuration
| readonly IConfiguration BetterFinds.Pages.MyAccountModel.configuration |
|
private |
The IConfiguration instance.
◆ ConfirmPassword
| string BetterFinds.Pages.MyAccountModel.ConfirmPassword = "" |
|
getset |
The password confirmation entered by the user.
◆ Email
| string BetterFinds.Pages.MyAccountModel.Email = "" |
|
getset |
The email entered by the user.
◆ FullName
| string BetterFinds.Pages.MyAccountModel.FullName = "" |
|
getset |
The full name entered by the user.
◆ OptNewsletter
| bool BetterFinds.Pages.MyAccountModel.OptNewsletter = false |
|
getset |
Whether the user wants to subscribe to the newsletter.
◆ Password
| string BetterFinds.Pages.MyAccountModel.Password = "" |
|
getset |
The password entered by the user.
◆ ProfilePic
| string? BetterFinds.Pages.MyAccountModel.ProfilePic |
|
getset |
The profile picture entered by the user.
◆ Username
| string BetterFinds.Pages.MyAccountModel.Username = "" |
|
getset |
The username entered by the user.
The documentation for this class was generated from the following file:
- BetterFinds/Pages/MyAccount.cshtml.cs