I was reading up on this and it seemed like I shouldn't have to call scope.Complete for the following code to work.
When I try running this without using scope.Complete() the records are saved to the database. If scope.Complete() is there the records save and everything works.
public static void SaveProducts(IList<Product> products)
{
using (TransactionScope scope = new TransactionScope())
{
using (var connection = GetOpenConnection())
{
StringBuilder sqlDelete = new StringBuilder();
sqlDelete.AppendLine("MY SQL STATEMENT HERE ");
StringBuilder sqlInsert = new StringBuilder();
sqlInsert.AppendLine("MY SQL STATEMENT HERE ");
connection.Execute(sqlDelete.ToString(), new { CategoryId = categoryId });
connection.Execute(sqlInsert.ToString(), products);
}
scope.Complete();
}
}