none
Can I have multiple DbContext in single transaction RRS feed

  • Question

  • I've bee googling a lot in multiple DbContexts subject, but I still can't got a good answer.

    Can I have a single transaction with multiple Dbcontexts, I don't want to use TransactionScope due to some reason.

    In my project, we use DataContext now, and I can do this

    //  init and setup trans first

    AContext a = new AContext(conn)

    BContext b = new BContext(conn)

    a.Transaction = trans

    b.Transaction = trans

    trans.Commit()

    Is any way in DbContext allow me to do the same things?

    Thanks.

    Friday, December 7, 2012 3:29 AM

All replies