One of my parameter looks like this:
cmd.Parameters.Add("@last_sign_in_at", SqlDbType.DateTime).Value = user.last_sign_in_at;
I know that User has null value in last_sign_in_at. Database accept nulls for this column but I get an exception:
SqlException: The parameterized query '(@id int,@name nvarchar(18),@username nvarchar(11),@state nvarch' expects the parameter '@last_sign_in_at', which was not supplied.
connection.Execute(@"...SQL...", new { user.last_sign_in_at });