peter

peter

  • NA
  • 320
  • 0

How to manipulate a generic sortedlist with object values

Jun 26 2023 12:56 AM

I have SortedList collection. The key is a unique ProductID value whereas the value represents a Product item.

I am trying to find all product objects that have multiple Vendors  (i.e with matching VendorID(UniqueIdentifier) properties). Then carry out some calculations on product properties  e.g discount ShipingFee(decimal) property and the lowest obtained ItemPrice by 10% from each Vendors Product object.

With the exception of those with a ShippingFee equal  to 0.0000 (database value).

The sortedlist should then be updated with the new ShippingFee and ItemPrice values in their original respective  element

Example

vendor1 ,20.39

vendor2 ,10,30

vendor2 ,10,20

output 

vendor2  11,22


Answers (3)