Working with JSON in C# ASP NET Core without deserialization

I would like to know if there is a quicker and direct way to read and write in C# ASP NET Core without having to create classes of JSON data models.

Consider the following JSON data received from an API. Is there a way to read fields as strings directly without having to deserialize them using JsonSerializer?

  "data": [
      "id": "100285832430"
      "id": "102602230220"
  "paging": {
    "cursors": {
      "before": "MTAwMTIxMDMyNDMw",
      "after": "MTAyNjY4NzAyMjIw"

Thank you


You can very easily copy some json text and then translate it to a model.

enter image description here

Or use something like

You can also use an anonymous object:

Or even a dynamic

Btw, You can also read partial json if you’re dealing with large datasets:

I gues you could also use regex to parse the string or write custom logic – but ofcourse i would not recommend that.

For example: "id": "([0-9]*)" to get all id’s.

This however is not faster for development and i doubt it’ll be faster for the app. Just stick with models and json. I’m not sure about your setup but perhaps there are things to automate if you have a lot of models?