title: How to map a JSON value to a model property of a different name
body: <p>How do you map a <code>JSON</code> property value to a model property of a different name using the <code>HttpClient</code> library using the <code>.NET 4.5.1</code> framework and <code>C#</code>?</p>
  
  <p>I am using the API from Weather Underground, and I created a console app just to test it out before I make the move to an <code>ASP.NET MVC 5</code> web app.</p>
  
  <pre><code>static void Main(string[] args)
  {
       RunAsync().Wait();
  }
  
  static async Task RunAsync()
  {
       string _address = "http://api.wunderground.com/api/{my_api_key}/conditions/q/CA/San_Francisco.json";
  
       using (var client = new HttpClient())
       {
            try
            {
                 HttpResponseMessage response = await client.GetAsync(_address);
                 response.EnsureSuccessStatusCode();
  
                 if (response.IsSuccessStatusCode)
                 {
                      Condition condition = await response.Content.ReadAsAsync&lt;Condition&gt;();
                 }
                 Console.Read();
            }
            catch (HttpRequestException e)
            {
                 Console.WriteLine("\nException Caught!");
                 Console.WriteLine("Message :{0} ", e.Message);
            }
       }
  }
  </code></pre>
  
  <p>My model classes to here I need the data populated:</p>
  
  <pre><code>public class Condition
  {
       public Response Response { get; set; }
  }
  
  public class Response
  {
       public string Terms { get; set; }
  }
  </code></pre>
  
  <p>My partial JSON result:</p>
  
  <pre><code>{
       "response": {
            "version":"0.1",
            "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
            "features": {
                 "conditions": 1
            }
       }
  }
  </code></pre>
  
  <p>This is a very basic example, buy how do I map the termsofservice value returned in the JSON to the Terms property in my response class?  If possible I would like to stay in the bounds of the libraries used above, and not resolve to a 3rd party library like <code>JSON.NET</code>. If it can't be done then I will look into a 3rd party library.</p>
  
  <p>I can probably have classes with properties with the same name as the data properties returned in the JSON, but I like to stick to best practices when naming properties and the properties need to have decent names.</p>