BetterFinds
Public Member Functions | Private Attributes | List of all members
BetterFinds.Utils.Images Class Reference

Provides utility functions for handling images-related operations. More...

Public Member Functions

 Images (IConfiguration configuration)
 Initializes a new instance of the Images class. More...
 
string GetImages (int productId)
 Returns the images string of the product with the specified ProductId. More...
 
List< string > ParseImagesList (string images)
 Returns a list of images from the specified images string. More...
 
List< string > GetImagesList (int productId)
 Returns a list of images from the product with the specified ProductId. More...
 
bool IsValidImages (string Images, ref string errorMessage)
 Validates the specified images string. More...
 

Private Attributes

readonly IConfiguration configuration
 The IConfiguration instance. More...
 

Detailed Description

Provides utility functions for handling images-related operations.

Constructor & Destructor Documentation

◆ Images()

BetterFinds.Utils.Images.Images ( IConfiguration  configuration)

Initializes a new instance of the Images class.

Parameters
configurationThe IConfiguration instance.

Member Function Documentation

◆ GetImages()

string BetterFinds.Utils.Images.GetImages ( int  productId)
inline

Returns the images string of the product with the specified ProductId.

Parameters
productIdThe 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
productIdThe 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
ImagesImages string to validate.
errorMessageError 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
imagesThe images string.
Returns
A list of images from the specified images string.

Member Data Documentation

◆ configuration

readonly IConfiguration BetterFinds.Utils.Images.configuration
private

The IConfiguration instance.


The documentation for this class was generated from the following file: