HotelController h1 = null; HotelController h2 = null; foreach (HotelController h in hList) { if (h1 == null && h2 == null) { h1 = h; h2 = h; continue; } if (h.CheapestRate < h1.CheapestRate) { h1 = h; } if (h.CheapestRate > h2.CheapestRate) { h2 = h; } } minPrice = Convert.ToInt32(h1.CheapestRate.ToString()); maxPrice = Convert.ToInt32(h2.CheapestRate.ToString());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)