Hi Naveen,
By default, Core to JavaScript camelCase is serialized,
so you need to customize the property names and values. You can refer to the
shared reference link below for serialization and change the JsonNamingPolicy,
as shown in the code snippet shared below.
Customize propertyNames: How
to customize property names and values with System.Text.Json - .NET | Microsoft
Learn
// you need to customize the serialize options and change
the JsonNamingPolicy.
|
var serializeOptions = new JsonSerializerOptions
{
PropertyNamingPolicy =
JsonNamingPolicy.CamelCase,
WriteIndented = true
};
jsonString = JsonSerializer.Serialize(weatherForecast,
serializeOptions);
|
Please get back to us if you need any further assistance.
Regards,
Vijay