4 ms·
Yep agreed, and this is the main argument for using functional query languages (like LINQ) as you can control the eval order explicitly. I'm also a fan of usin
by alexisread 5y ago
Yep agreed, and this is the main argument for using functional query languages (like LINQ) as you can control the eval order explicitly.
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.
- ako 5y agoHow do you rewrite your linq query when the data in your tables change, and the eval order is no longer correct?
- alexisread 5y agoWell 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.