Say I had the following json
{
"employees": [{
"firstName": "John",
"lastName": "Doe"
}, {
"firstName": "Anna",
"lastName": "Smith"
}, {
"firstName": "Peter",
"lastName": "Jones "
}
]
}
When I use Edit > Paste JSON as Classes the following class gets created:
namespace JSONUtils
{
public class Employee
{
public string firstName { get; set; }
public string lastName { get; set; }
}
public class Example
{
public IList<Employee> employees { get; set; }
}
}
Notice the string firstName
, this should be FirstName
. Is there a way of Visual Studio sticking to naming convention rules?
The following site helps do this, but would be great if this was in VS: https://jsonutils.com/
Is there a way of Visual Studio sticking to naming convention rules?
Alas no. There is no way of customising this (in Visual Studio, unless you install extra plugins / extensions).
Your best bet is to keep using https://jsonutils.com or https://app.quicktype.io/#l=cs&r=json2csharp (or one of the plugins / extensions).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With