test/Shared/FunctionalTests.Transitional/TestHelpers/FunctionalTestBase.cs
/// <summary>
/// Ensures the database for the context is created and seeded.  This is typically used
/// when a test is going to use a transaction to ensure that the DDL happens outside of
/// the transaction.
/// </summary>
/// <param name="createContext"> A func to create the context. </param>
Ensures the database for the context is created and seeded.  This is typically used
when a test is going to use a transaction to ensure that the DDL happens outside of
the transaction.
Ensures the database for the context is created and seeded . This is typically used when a test is going to use a transaction to ensure that the DDL happens outside of the transaction .
protected static void EnsureDatabaseInitialized(Func<DbContext> createContext)
        {
            using (var context = createContext())
            {
                ExtendedSqlAzureExecutionStrategy.ExecuteNew(
                    () => context.Database.Initialize(force: false));
            }
        }
protected static void EnsureDatabaseInitialized ( Func < DbContext > createContext ) { using ( var context = createContext ( ) ) { ExtendedSqlAzureExecutionStrategy . ExecuteNew ( ( ) => context . Database . Initialize ( force : false ) ) ; } }
Ensures the database for the context is created and seeded.
Ensures the database for the context is created and seeded .
createContext
Func<DbContext>
A func to create the context.
A func to create the context .