Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to get the JSON fields in all lowercase

$
0
0

Hello:
I have a ASP .net Core service that returns data directly from SQL Server as a JSON. See sample result below.
Depending on how the stored procedure is written, the column names are mixed in lower/upper cases and this makes it hard for me to bind it correctly.

Without changing the underlying stored procedures, I would simply like to have my service change the field names in the JSON result to be all lower case.
What would be the easiest way to do this without having to repeat this in every method cotnained in my service?

{

"success": true,
"statusCode": 200,
"data": [
{
"id": 1,
"Name": "Home",
"menu_text": "Home",
"State_name": "home.accountsummary",
"URL_text": "Some Value",
"Parent_menu_name": null,
"level": 1,
"seq_no": 10100,
"menu_column_count": null,
"menu_row_count": null,
"image_url": "CustomerPortal/Images/menu/home.png",
"is_hidden": false,
"menu_level": null,
"customer_portal_menu_settings_id": 1,
"is_custom": false,
"url": null,
"templateUrl": null,
"controller": null,
"controllerAs": null
}]
}


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>