Model for the Edit Auction page. This class is decorated with the Authorize attribute.
More...
Model for the Edit Auction page. This class is decorated with the Authorize attribute.
◆ EditModel()
BetterFinds.Pages.EditModel.EditModel |
( |
IConfiguration |
configuration | ) |
|
Initializes a new instance of the EditModel class.
- Parameters
-
configuration | The IConfiguration instance. |
◆ OnGet()
IActionResult BetterFinds.Pages.EditModel.OnGet |
( |
| ) |
|
|
inline |
Shows the edit auction page.
Checks if the auction exists and belongs to the client. If so, displays the auction details. Otherwise, redirects to the not found error (404) page.
- Returns
- A task that represents the action of loading the edit auction page.
◆ OnPost()
IActionResult BetterFinds.Pages.EditModel.OnPost |
( |
| ) |
|
|
inline |
Edits the auction if all requirements are met.
Checks if the auction exists and belongs to the client. If so, updates the auction details as long as they meet the validation requirements:
-
Minimum bid must be greater than 0.
-
Title must be between 1 and 64 characters.
-
Description must be between 1 and 2048 characters.
-
Images must be valid.
If the auction details are updated successfully, redirects to the edit auction page with a success message. Otherwise, redisplays the edit auction page with an error message.
- Returns
- A task that represents the action of editing the auction.
◆ configuration
readonly IConfiguration BetterFinds.Pages.EditModel.configuration |
|
private |
The IConfiguration instance.
◆ Description
string BetterFinds.Pages.EditModel.Description = "" |
|
getset |
◆ Images
string? BetterFinds.Pages.EditModel.Images |
|
getset |
◆ MinimumBid
decimal BetterFinds.Pages.EditModel.MinimumBid = 0.01M |
|
getset |
◆ Title
string BetterFinds.Pages.EditModel.Title = "" |
|
getset |
The documentation for this class was generated from the following file:
- BetterFinds/Pages/Edit.cshtml.cs