public IActionResult GetTimeZoneDetailsByPlaceName(string placeName) { try { if (!string.IsNullOrWhiteSpace(placeName) && !string.IsNullOrEmpty(placeName)) { try { IEnumerable <GeonamesAPI.Domain.TimeZone> result = repository.GetTimeZoneDetailsByPlaceName(placeName); if (result != null || result.Count() > 0) { return(Ok(result)); } else { return(NotFound()); } } catch (Exception ex) { Debug.WriteLine(ex); throw; } } else { return(BadRequest("Please provide a valid value for name of the place of which the time zone is required.")); } } catch (Exception ex) { Debug.WriteLine(ex); throw; } }