public IActionResult Search(int minPrice, int maxPrice) { var properties = propertiesService.SearchByPrice(minPrice, maxPrice); if (minPrice == 0 && maxPrice == 0) { properties = null; } return(this.View(properties)); }
private static void PropertySearchByPrice(IPropertiesService propertiesService) { Console.Write($"Min price: "); var minPrice = decimal.Parse(Console.ReadLine()); Console.Write($"Max price: "); var maxPrice = decimal.Parse(Console.ReadLine()); var properties = propertiesService.SearchByPrice(minPrice, maxPrice); foreach (var property in properties) { Console.WriteLine ($"{property.DistrictName}; {property.BuildingType}; {property.PropertyType} => {property.Price}€ => {property.Size}m²"); } }