Click here to Skip to main content
15,895,084 members

Comments by Nkhanedzeni (Top 23 by date)

Nkhanedzeni 25-Jun-21 15:07pm View    
It seems Parallel.ForEach will make things easier. I did a bit of digging and i come up with the below. I want to add to this list
List<rate> rates = new List<rate>();

Parallel.ForEach(insertDestinations, destination => {

//Now i am not sure how i can continue base on my Foreach statement. Can you please assist?
});
Nkhanedzeni 25-Jun-21 5:40am View    
I have fixed it by removing extra param.

How can i optimize this as well

foreach (var destination in insertDestinations)
{
Rate rate = new Rate()
{
DestinationGroup = rateSheetSummary.Description,
Description = rateSheetSummary.Description,
DestinationId = destination.DestinationId,
Country = rateSheetSummary.CountryCode,
TariffId = tariffId,
NextPrice = rateSheetSummary.Peak,
Price = rateSheetSummary.Peak,
Interval = 1,
Discontinued = "N",
Forbidden = "N"
};

rates.Add(rate);
}
Nkhanedzeni 25-Jun-21 5:36am View    
It is giving me this error: "No overload method 'Contains' takes two arguments"
Nkhanedzeni 7-Jun-21 8:07am View    
Thanks, why is it adding the backslash or will it work like this?
"\"testing1\",\"testing2\",\"testing3\",\"testing4\",\"testing5\",\"testing6\""
Nkhanedzeni 16-Jan-20 8:35am View    
Thank you, it worked like a champ