Exemplo n.º 1
0
        public static EF6Model CreateWithFileMapping(ContentAccess contentAccess, string path, SqlConnection connection, bool contextOwnsConnection)
        {
            var schemaProvider = new FileSchemaProvider(path);
            var configurator   = new MappingConfigurator(contentAccess, schemaProvider);

            return(Create(configurator, connection, contextOwnsConnection));
        }
Exemplo n.º 2
0
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            var schemaProvider = new StaticSchemaProvider();
            var mapping        = new MappingConfigurator(DefaultContentAccess, schemaProvider);

            mapping.OnModelCreating(modelBuilder);
        }
Exemplo n.º 3
0
        public static EF6Model CreateWithDatabaseMapping(ContentAccess contentAccess, string siteName, SqlConnection connection, bool contextOwnsConnection)
        {
            var schemaProvider = new DatabaseSchemaProvider(siteName, connection);
            var configurator   = new MappingConfigurator(contentAccess, schemaProvider);
            var context        = Create(configurator, connection, contextOwnsConnection);

            context.SiteName = siteName;
            return(context);
        }