Note that there are some explanatory texts on larger screens.

plurals
  1. USTyco Kaine
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COTrue - that particular check could be simplified - that's the trouble with inventing examples ;) I guess that level of simplifcation is a good first step, but doesn't really address the wider requirement for a more readable and testable way to code complicated clauses. Isn't the computed column limited to the scope of the table? If so, it cannot handle any context data and so, other than in a possible performance variation I'm not sure how it's different from using a public property in c#. A property could be used to simplify the example slightly - but not to the same extent as object methods.
      singulars
    2. COI think this is a step in the right direction - but it's still pretty difficult to see what's going on... it would be worse if the bottom level operator was 'OR' because this technique wouldn't help at all. The LINQ-to-gubbins version is much easier to read and each of the methods can have simple, testable condition in them and so it's easy to verify that the results are correct. Is there no way to get this seperation with LINQ-to-SQL?
      singulars
    3. COI think moving the conditional clauses to a stored procedure only shifts the problem into the DB. It may be possible to make the conditions easier to read there, but I think the added level of complexity will only make readability worse because then you'd need to go poking about in the database to find out what's going on (and the same code might run against different databases so there may also be all kinds of other maintainance issues ensuring that the stored proc is in sync with the build)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload