C# – Exception filters – conditionally catch exceptions

In C# 6 they added exception filtering. This allows you to conditionally catch exceptions. To filter exceptions, you use the when clause after the catch clause, like this: Any SqlException that doesn’t meet the condition will not be caught. Previously, without exception filtering, you’d have to handle that scenario in the catch block and rethrow, … Read more C# – Exception filters – conditionally catch exceptions

C# – How to use IN with Dapper

Let’s say you have a SQL Query that uses IN and you want to execute it using Dapper. Your query looks something like this: Here’s how you’d execute that with Dapper: Then you’d call it like this: There are two key things to notice about this: You have to exclude the parentheses. I specified one … Read more C# – How to use IN with Dapper