By default every single data operation is transactional in NMemory. However, if you want to execute multiple operations in the same transaction, you have to use a transaction scope.

The following example removes all the entities from the database in a single transaction.

using (TransactionScope scope = new TransactionScope())
{
    db.People.Delete();
    db.Groups.Delete();

    scope.Complete();
}

Last edited Jun 11, 2012 at 9:59 AM by tamasflamich, version 7

Comments

No comments yet.