public models.WeatherReport GetWeatherForAirport(string airportCode) { var airport = _airports.GetAirportByCode(airportCode); var forecast = _forecaster.GetCurrentConditions(airport.Location); return(new models.WeatherReport(forecast)); }
public HttpResponseMessage AddFavorite(int userId, string airportCode) { var user = _users.GetUserById(userId); var airport = _airports.GetAirportByCode(airportCode); user.AddFavouriteAirport(airport); return(Request.CreateResponse(HttpStatusCode.Created)); }