I cannot solve a problem for several hours now.
Here is a simplified scenario.
Let's say there is a list of people with their bids. I'm trying to find a person with the highest bid and return the name. I am able to find the highest bid, but how to I output the name?

The best solution from an architectural point of view is to create a separate class (e.g. Person) that contains two properties Name and Bid of each person and a class Persons that contains the list of persons.

Then you can easily use a LINQ command.

Also instead of storing bids as string, think if bids as floating point or decimal values would be better (or store it in cents and use an int).

I do agree, the class would be easier to deal with. But due to the nature of the problem (web services, etc) I didn't want to create additional class. Thank you for your time!
–
AlexAug 15 '12 at 13:49

1

Doesn't the Max method you used there return an int?
–
Şafak GürAug 15 '12 at 13:51

No problem at all ... I extended the answer anyway to show others how classes can help increase readability and splitting responsibilities.
–
Michel KeijzersAug 15 '12 at 13:52

I changed Max to MaxBy, assuming it returns the person with the maximum bid, and than take the name of that person.
–
Michel KeijzersAug 15 '12 at 13:54