I have a class like this
class car
{
public string carName { get; set; }
public decimal price { get; set; }//Group id
}
I have two lists like this
List<car> listCars = new List<car>();
List<car> lowest = new List<car>();
I want to search for the car with lowest price in the listCars list and add the lowest price car object to the list lowest.
var minPrice = lstCars.Min(carobj=>carobj.price);
but in this you get only the minimum car price only. I want to get the car object and add it to the lowest list. How to do that?