How do I convert ModelState to JSON in the same format that ASP.NET Core does?
I know I can do BadRequest(ModelState) and it will return JSON to the client. How does it convert ModelState to JSON? And more importantly, how can I use what it is using?
My goal is to log the ModelState as JSON in our log "files".
i.e. var blah = ModelState.ToJson()