I created a method that takes in a JSONElement parameter. The problem is that whenever I execute the method and pass it a json object, the parameter is always of value undefined.
Why is this happening?
The following is the method that I am trying to work with:
public string GetJsonElement(JsonElement data)
{
return "Done";
}
Whenever I put breakpoints in my code to check the data parameter's value, this keeps showing up:
data ValueKind = Undefined : "" System.Text.Json.JsonElement
The Json I am passing:
{
"User":"User1",
"FullName":"Jane Doe"
}
Could someone shed some light on what is happening and how I can maybe get rid of the problem please?
I was able to resolve by removing newtonsoft as my serializer for mvc from startup