public async Task <IActionResult> SearchPlaces(string search = null) { IEnumerable <PlaceListGetModel> places = default; if (!string.IsNullOrEmpty(search)) { places = await placeService.SearchPlacesAsync(search); } places = await placeService.AllAysnc(); return(Ok(places)); }
public async Task <IActionResult> SearchPlaces(string search = null) { if (!string.IsNullOrEmpty(search)) { var foundPlaces = await placeService.SearchPlacesAsync(search); return(View("List", foundPlaces)); } var places = await placeService.AllAysnc(); return(View("List", places)); }