public async Task <HttpResponseMessage> Get() { var wi = await Task.Run(() => weatherInfo.GetWeather()); if (wi == "Internal Server Error") { return(Request.CreateResponse(HttpStatusCode.InternalServerError, wi)); } return(Request.CreateResponse(HttpStatusCode.OK, wi)); }
public async Task <string> Execute(Message msg) { var split = msg.Text.Split(' ', 2); // [команда, параметры] if (split.Length < 2) { return("Не все параметры указаны!"); } var city = split[1].Trim().ToLower(); return(await _weather.GetWeather(city)); }