How do you rewrite your linq query when the data in your tables change, and the eval order is no longer correct?
Re:SQL for Distributed Systems
by alexisread on Wednesday October 13, 2021 @06:03PM
(#28858229)
Well you switch to a different linq query as your heuristic changes.
This isn't a linq vs SQL debate. I'm pointing out that linq allows explicit ordering, and if you know the shape of your data, you can account for changes in it.
As with most coding, right tool for the job, YMMV for SQL or linq.
I'm also a fan of using CTEs in a template, so all template arguments can be grouped together at the top of the query.
Additionally, multiple CTEs in a query execute as a single transaction, and in order (well, for Postgres anyway and probably SQL server) which can allow for multiple (different dependent tables) updates in a query without the roundtrips to say the API layer.