/// <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 configuration) // EntityFrameworkConfiguration is provided as an IoC dependency for EntityFrameworkContext in order to initialize the global DbConfiguration before using DbContext. : base(connection, true) { Initialize(); }
public EntityFrameworkContext( Rhetos.Persistence.IPersistenceTransaction persistenceTransaction, Rhetos.Dom.DefaultConcepts.Persistence.EntityFrameworkMetadata metadata, EntityFrameworkConfiguration configuration) // EntityFrameworkConfiguration is provided as an IoC dependency for EntityFrameworkContext in order to initialize the global DbConfiguration before using DbContext. : base(new System.Data.Entity.Core.EntityClient.EntityConnection(metadata.MetadataWorkspace, persistenceTransaction.Connection), false) { Initialize(); Database.UseTransaction(persistenceTransaction.Transaction); }