Replies: 1 comment
-
conn.Insert(item, statement => statement.AttachToTransaction(trans)). It's in the wiki |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am a new user of FastCrud and I am currently facing a problem where I need to enable transactions when inserting and updating data. I followed the previous method, but it has not been successful. Can someone tell me how to enable transactions in FastCrud.
using (IDbConnection conn = new SqlConnection(connStr))
{
conn.Open();
using (IDbTransaction trans = conn.BeginTransaction())
{
try
{
foreach (var item in list)
{
conn.Insert((DBModelData)item);
}
}
Beta Was this translation helpful? Give feedback.
All reactions