Property name changed (to lowercase)

I have a custom model in my project that not related to database table. Here's my code in a function in ServerMethodController.cs:

var data = new Models.CustomModel();
...
data.FirstLine = "test";
data.SecondLine = "demo";
...
return Json(new { err, message, data });

and the result become:

data.firstLine = "test"
data.secondLine = "demo"

Is it really intended behaviour?

Because when I execute a server method that returns a recordset, the first character in the property name still an uppercase.

Thanks.

This is not related to Radzen at all:
https://www.google.com/search?rlz=1CDGOYI_enBG769BG769&hl=en-GB&sxsrf=ALeKk02CAsQ9eVjyWX9e__CPV1bHlEy_IA%3A1595743031021&ei=NxsdX8N10ZKbBYWXjkg&q=+json+serialize+lowercase+first+letter&oq=+json+serialize+lowercase+first+letter&gs_lcp=ChNtb2JpbGUtZ3dzLXdpei1zZXJwEAMyBggAEAcQHjIGCAAQCBAeOgQIABBHOgcIIxCwAhAnUJDBAljmygJg1NACaABwAngAgAF0iAH1B5IBAzYuNJgBAKABAcABAQ&sclient=mobile-gws-wiz-serp

Even though this is not related to Radzen we have it mentioned in our documentation:

public IActionResult OrdersByCity()
{
    var orders = northwind.Orders.GroupBy(o => o.ShipCity)
                 .Select(group => new {
                    ShipCity = group.Key,
                    Count = group.Count()
                 });


    // Using DefaultContractResolver to preserve the property
    // name casing when serializing the result to JSON.
    return Json(new { value = orders }, new JsonSerializerSettings() {
       ContractResolver = new DefaultContractResolver()
    });
}

Okay, thanks for the replies.

To be honest I dont read the documentation, just jump to radzen and then search if theres a problem. And this problem don't have any special section.

Thank you.

We can't document any possible problem a developer may hit with their custom code. We document (and support) Radzen specific features and behavior.

Yup, I understand that, Just mentioned in my reply that I miss that information because I dont read throughly. And its clearly the behaviour is not designed by Radzen team :slight_smile:

Thankyou.