test/Shared/FunctionalTests/ProductivityApi/ConcurrencyTests.cs
/// <summary>
///     Runs the same action twice inside a transaction scope but with two different contexts and calling
///     SaveChanges such that first time it will succeed and then the second time it will result in a
///     concurrency exception.
///     After the exception is caught the resolver action is called, after which SaveChanges is called
///     again.  Finally, a new context is created and the validator is called so that the state of
///     the database at the end of the process can be validated.
/// </summary>
Runs the same action twice inside a transaction scope but with two different contexts and calling
SaveChanges such that first time it will succeed and then the second time it will result in a
concurrency exception.
After the exception is caught the resolver action is called, after which SaveChanges is called
again.  Finally, a new context is created and the validator is called so that the state of
the database at the end of the process can be validated.
Runs the same action twice inside a transaction scope but with two different contexts and calling SaveChanges such that first time it will succeed and then the second time it will result in a concurrency exception . After the exception is caught the resolver action is called after which SaveChanges is called again . Finally a new context is created and the validator is called so that the state of the database at the end of the process can be validated .
private void ConcurrencyTest(
            Action<F1Context> change, Action<F1Context, DbUpdateException> resolver,
            Action<F1Context> validator)
        {
            ConcurrencyTest(change, change, resolver, validator);
        }
private void ConcurrencyTest ( Action < F1Context > change , Action < F1Context , DbUpdateException > resolver , Action < F1Context > validator ) { ConcurrencyTest ( change , change , resolver , validator ) ; }
Runs the same action twice inside a transaction scope but with two different contexts and calling
SaveChanges such that first time it will succeed and then the second time it will result in a
concurrency exception.
Runs the same action twice inside a transaction scope but with two different contexts and calling SaveChanges such that first time it will succeed and then the second time it will result in a concurrency exception .
change
Action<F1Context>
resolver
Action<F1Context, DbUpdateException>
validator
Action<F1Context>