Skip to content

Instantly share code, notes, and snippets.

@ahmad-moussawi
Last active April 2, 2019 20:00
Show Gist options
  • Save ahmad-moussawi/67ac7b6951e219f2d34fc3a4b12e55ba to your computer and use it in GitHub Desktop.
Save ahmad-moussawi/67ac7b6951e219f2d34fc3a4b12e55ba to your computer and use it in GitHub Desktop.
sqlkata_tips_tricks.sql
SELECT * FROM [Books]
WHERE ([Status] = 'active' AND [AuthorId] IS NOT NULL)
OR ([IsPublished] = 1 AND [PublishedDate] IS NOT NULL)
db.Query("Books")
.Where(q => q.Where("Status", "active").WhereNotNull("AuthorId"))
.OrWhere(q => q.Where("IsPublished", 1).WhereNotNull("PublishedDate"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment