Hi Team,
Creating a web API using .net core 5
I was getting a error as" A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32."
After adding few library in startup.cs as below:
services.AddControllers().AddJsonOptions(o => o.JsonSerializerOptions .ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.Preserve);
Getting Response as below:
{
"$id": "1",
"$values": [
"$id": "2",
"id": 1,
"customerName": "ABC",
"customerMsisdn": "255678765678",
"bankName": "AXIS",
"wakalaCode": "1234",
"accountNumber": "123456544",
"channelId": 1,
"referenceId": "gagsfccfc"
}
]
My concern is I want the response as below:
"customerName": "Suchismita",
Not getting why these extra fields are getting added
Can anyone assist please?
Thanks