How to turn off or handle camelCasing in JSON response ASP.NET Core?
<p>I'm running through a WintellectNOW course on ASP.NET Core/Web API/Angular 2. I have the API portion implemented, but for whatever reason, the JSON that is being returned has the variable names being lowercased.</p>

<p>The returned JSON is formatted like...</p>

<pre><code>[
 {"id":1,"name":"Bowler","color":"black","count":1},
 {"id":2,"name":"Fedora","color":"red","count":1},
 {"id":3,"name":"Baseball Cap","color":"blue","count":3}
]
</code></pre>

<p>I'm expecting...</p>

<pre><code>[
 {"Id":1,"Name":"Bowler","Color":"black","Count":1},
 {"Id":2,"Name":"Fedora","Color":"red","Count":1},
 {"Id":3,"Name":"Baseball Cap","Color":"blue","Count":3}
]
</code></pre>

<p>Based on the C# model of...</p>

<pre><code>namespace HatCollection.Models
{
    public class Hat
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Color { get; set; }
        public int Count { get; set; }
    }
}
</code></pre>

<p>I even went as far as decorating the properties with <code>[DataMember(Name = "Id")]</code> just to make sure and it still didn't matter. </p>

<p>On the off chance, it's relevant the Action and instance variable in the controller...</p>

<pre><code>private static readonly List&lt;Hat&gt; MyHats = new List&lt;Hat&gt;
{
    new Hat {Id = 1, Name = "Bowler", Color = "black", Count = 1 },
    new Hat {Id = 2, Name = "Fedora", Color = "red", Count = 1 },
    new Hat {Id = 3, Name = "Baseball Cap", Color = "blue", Count = 3 }
};

[HttpGet]
public IEnumerable&lt;Hat&gt; Get()
{
    return MyHats;
}
</code></pre>

<p>How do I turn off the camelCase functionality, so that ASP.NET Core returns the property names without changing them?</p>