Normal Class:
--------------
public class BillerInfoResponse
{
[XmlElement(ElementName = "responseCode")]
public int ResponseCode { get; set; }
[XmlElement(ElementName = "biller")]
public Biller Biller { get; set; }
[XmlElement(ElementName = "errorInfo")]
public ErrorInfo ErrorInfo { get; set; }
}
string response = @"
BillerId's are:
---------------
Note:
Logic Here:
-----------
if (response != null && response != "")
{
XmlSerializer serializer = new XmlSerializer(typeof(BillerInfoResponse));
using (TextReader reader = new StringReader(response))
{
List
BillerInfoResponse objTransactionEnquiry = (BillerInfoResponse)serializer.Deserialize(reader);
foreach (string multipleResponse in responseList)
{
BillerInfoResponse copiedResponse = new BillerInfoResponse();
copiedResponse.ResponseCode = objTransactionEnquiry.ResponseCode;
}
}
}
My Requrement is : multiple Transaction done in fraction of second In that time multiple billerId is getting In that time how can i Store that BillerId's in data base from fornt end the above logic i have to tryed but not getting how can i solve this issue.
Jayraj ChhayaPosted Dec 18, 2023, 10:42 AM
Problem
The problem mentioned is related to storing multiple biller IDs in a database during multiple transactions that occur within a fraction of a second. The current logic does not address this issue, and the user is seeking a solution.
Cause
The cause of the problem is that the current logic only handles a single response at a time and does not account for multiple biller IDs in a single response or multiple transactions occurring simultaneously.
Solution
To solve the issue of storing multiple biller IDs in a database during multiple transactions, you can modify the existing logic as follows:
Create a database table to store the biller IDs. The table should have columns to store the transaction details, including the biller ID.
Modify the code to handle multiple responses and extract the biller IDs from each response. You can use a loop to iterate over the responses and extract the biller IDs.
Within the loop, create a new instance of the
BillerInfoResponseclass for each response and assign the extracted biller ID to theBillerIdproperty of the new instance.Insert the new instance of
BillerInfoResponseinto the database table, which will store the biller ID along with other transaction details.Here's an example of how the modified code could look:
Make sure to replace the database-related code with the actual code for inserting data into the database table.