title: Net Core Error The name 'Ok' does not exist in the current context
body: <p>I am receiving the following error: The name 'Ok' does not exist in the current context.</p>
  
  <p>How would I resolve this issue in my Controller API? Return Ok is already embedded in the controller.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.Mvc;
  using System.Net.Http;
  using Newtonsoft.Json;
  using WeatherTest.Models;
  
  namespace WeatherChecker.Controllers
  {
  
      public class WeatherData
      {
          [HttpGet("[action]/{city}")]
          public async Task&lt;IActionResult&gt; City(string city)
          {
              using (var client = new HttpClient())
              {
                  try
                  {
                      client.BaseAddress = new Uri("http://api.openweathermap.org");
                      var response = await client.GetAsync($"/data/2.5/weather?q={city}&amp;appid=YOUR_API_KEY_HERE&amp;units=metric");
                      response.EnsureSuccessStatusCode();
  
                      var stringResult = await response.Content.ReadAsStringAsync();
                      var rawWeather = JsonConvert.DeserializeObject&lt;OpenWeatherResponse&gt;(stringResult);
  
                      // Error Here: ** The name 'Ok' does not exist in the current context **
                      return Ok(new
                      {
                          Temp = rawWeather.Main.Temp,
                          Summary = string.Join(",", rawWeather.Weather.Select(x =&gt; x.Main)),
                          City = rawWeather.Name
                      });
                  }
                  catch (HttpRequestException httpRequestException)
                  {
                       // Error Here: The name 'BadRequest' does not exist in the current context
                      return BadRequest($"Error getting weather from OpenWeather: {httpRequestException.Message}");
                  }
              }
          }
      }
  }
  </code></pre>