Provides utility functions for handling images-related operations.
More...
Provides utility functions for handling images-related operations.
◆ Images()
BetterFinds.Utils.Images.Images |
( |
IConfiguration |
configuration | ) |
|
Initializes a new instance of the Images class.
- Parameters
-
configuration | The IConfiguration instance. |
◆ GetImages()
string BetterFinds.Utils.Images.GetImages |
( |
int |
productId | ) |
|
|
inline |
Returns the images string of the product with the specified ProductId.
- Parameters
-
productId | The ProductId of the product. |
- Returns
- The images string of the product with the specified ProductId.
◆ GetImagesList()
List<string> BetterFinds.Utils.Images.GetImagesList |
( |
int |
productId | ) |
|
|
inline |
Returns a list of images from the product with the specified ProductId.
Currently not being used.
Obtains the images list using GetImages(int) and parses it using ParseImagesList(string).
- Parameters
-
productId | The ProductId of the product. |
- Returns
- A list of images from the product with the specified ProductId.
◆ IsValidImages()
bool BetterFinds.Utils.Images.IsValidImages |
( |
string |
Images, |
|
|
ref string |
errorMessage |
|
) |
| |
|
inline |
Validates the specified images string.
Both used in Pages.CreateModel and Pages.EditModel.
Checks if the images string is 2048 characters or less and if the images are 10 or less.
- Parameters
-
Images | Images string to validate. |
errorMessage | Error message to return if validation fails. |
- Returns
- True if the images string is valid, false otherwise.
◆ ParseImagesList()
List<string> BetterFinds.Utils.Images.ParseImagesList |
( |
string |
images | ) |
|
|
inline |
Returns a list of images from the specified images string.
Splits the images string by comma and returns the resulting list.
Used in Pages.AuctionModel to display the images of the product.
- Parameters
-
- Returns
- A list of images from the specified images string.
◆ configuration
readonly IConfiguration BetterFinds.Utils.Images.configuration |
|
private |
The IConfiguration instance.
The documentation for this class was generated from the following file:
- BetterFinds/Utils/Images.cs