Provides utility functions for handling bids-related operations. More...
Public Member Functions | |
Bids (IConfiguration configuration) | |
Initializes a new instance of the Bids class. More... | |
async Task | CreateBidderGroupAsync () |
Creates a dictionary of auctions and their bidders asynchonously. More... | |
async Task | AddBidderToBidderGroupAsync (int clientId, int auctionId) |
Adds a bidder to the biddersGroup dictionary asynchonously. More... | |
List< int > | GetBiddersFromAuction (int auctionId) |
Returns a list of bidders from the specified auction. More... | |
List< Dictionary< int, List< Dictionary< string, object > > > > | GetClientBids (int clientId) |
Returns a list of bidders organized by auction. More... | |
void | PrintBiddersGroup () |
Prints the biddersGroup dictionary. More... | |
Properties | |
static Dictionary< int, List< int > > | BiddersGroup = [] [get, set] |
The dictionary of auctions and their bidders. More... | |
Private Attributes | |
readonly IConfiguration | configuration |
The IConfiguration instance. More... | |
Provides utility functions for handling bids-related operations.
BetterFinds.Utils.Bids.Bids | ( | IConfiguration | configuration | ) |
Initializes a new instance of the Bids class.
configuration | The IConfiguration instance. |
|
inline |
Adds a bidder to the biddersGroup dictionary asynchonously.
Used to add a bidder to the biddersGroup dictionary when a bid is placed.
The dictionary is stored in the BiddersGroup property.
clientId | The ClientId of the bidder. |
auctionId | The AuctionId related to the bid. |
|
inline |
Creates a dictionary of auctions and their bidders asynchonously.
This method is called from Program when the application starts.
It retrieves all bids from the database and creates a dictionary of auctions and their bidders.
The dictionary is stored in the BiddersGroup property.
|
inline |
Returns a list of bidders from the specified auction.
Used to get a list of bidders to notify from the specified auction.
If the auctionId is not present in the dictionary, it returns an empty list.
The dictionary is stored in the BiddersGroup property.
auctionId | The AuctionId to get bidders from. |
|
inline |
Returns a list of bidders organized by auction.
Used to get a list of bidders organized by auction in the Pages.MyBidsModel page.
The list is structured as follows:
The dictionaries containing the bid information are structured as follows:
clientId | The ClientId of the client to get bids organized by auction from. |
|
inline |
Prints the biddersGroup dictionary.
Used for debugging purposes.
Prints the contents of the BiddersGroup dictionary.
|
private |
The IConfiguration instance.
|
staticgetsetprivate |
The dictionary of auctions and their bidders.
This property can only be set from within the class.
This dictionary BiddersGroup
is initialized when the application starts.
Used to notify clients when a bid is placed on an auction they are participating in.
Dictionary structure: