How to rollback a transaction using dapper

Viewed 12529

I have this:

            using (var con= new SqlConnection(ConfigurationManager.ConnectionStrings["sqlcon"].ConnectionString))
            {
                try
                {
                  // many transactions
                }
                catch (Exception e)
                {
                    con.BeginTransaction().Rollback();
                }
            }

Will this work is my question.. I know another method is to make a transaction then open it then rollback.

1 Answers
Related