Nested data structures are a pain to load and save to the database. That’s the primary reason ORMs exist. They auto generate code objects based on the tables or vice versa and handle saving nested objects in one transaction. I hate ORMs but I am a fan of “micro ORMs” like Dapper, which just maps rows to objects.
Instead of using an ORM for nested objects, I store the object as a JSON document. Postgres has a lot of good functionality around these.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.