/// <summary>
 /// This constructor is used at deployment-time to create slow EntityFrameworkContext instance before the metadata files are generated.
 /// The instance is used by EntityFrameworkGenerateMetadataFiles to generate the metadata files.
 /// </summary>
 protected EntityFrameworkContext(
     System.Data.Common.DbConnection connection,
     EntityFrameworkConfiguration entityFrameworkConfiguration, // EntityFrameworkConfiguration is provided as an IoC dependency for EntityFrameworkContext in order to initialize the global DbConfiguration before using DbContext.
     Rhetos.Utilities.IConfiguration configuration)
     : base(connection, true)
 {
     _configuration = configuration;
     Initialize();
 }
 public EntityFrameworkContext(
     Rhetos.Persistence.IPersistenceTransaction persistenceTransaction,
     Rhetos.Dom.DefaultConcepts.Persistence.EntityFrameworkMetadata metadata,
     EntityFrameworkConfiguration entityFrameworkConfiguration, // EntityFrameworkConfiguration is provided as an IoC dependency for EntityFrameworkContext in order to initialize the global DbConfiguration before using DbContext.
     Rhetos.Utilities.IConfiguration configuration)
     : base(new System.Data.Entity.Core.EntityClient.EntityConnection(metadata.MetadataWorkspace, persistenceTransaction.Connection), false)
 {
     _configuration = configuration;
     Initialize();
     Database.UseTransaction(persistenceTransaction.Transaction);
 }