dotConnect for PostgreSQL Documentation
In This Topic
    Entity Framework Provider Configuration
    In This Topic

    Entity Framework support features can be configured either in code using Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfig class or in the project .config file. The PgSqlEntityProviderConfig class is available in the Devart.Data.PostgreSql.Entity.dll assembly. For example, this code is used to enable batch updates feature:

    PgSqlEntityProviderConfig config = PgSqlEntityProviderConfig.Instance;  
    config.DmlOptions.BatchUpdates.Enabled = true;  
    
    
    Dim Config As PgSqlEntityProviderConfig
    Config = PgSqlEntityProviderConfig.Instance
    Config.DmlOptions.BatchUpdates.Enabled = True
    
    

    To configure Entity Framework provider with a config file, you need to add the following section to the configSections tag:

    <configSections>
      <section name="Devart.Data.PostgreSql.Entity" 
      type="Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfigurationSection, 
      Devart.Data.PostgreSql.Entity.EF[Version], Version=7.1.26.0, Culture=neutral, 
      PublicKeyToken=09af7300eec23701" />
    </configSections>  
    

    Where [Version] is the version of the Entity Framework used. For Entity Framework v1 it is "1", for Entity Framework v4 it is "4", for Entity Framework v5 and v6 it is "5" or "6" respectively. For Entity Framework Core it is "Core".

    If there is no configSections element in your config file, add it. It must be the first element. If it's not the first element, your application will throw an error when starting.

    Then add the following element to the configuration tag:

     <Devart.Data.PostgreSql.Entity xmlns="http://devart.com/schemas/Devart.Data.PostgreSql.Entity/1.0">
     </Devart.Data.PostgreSql.Entity>
    

    And use the following elements of the Devart.Data.PostgreSql.Entity tag to configure Entity Framework provider.

    For more details on using PgSqlEntityProviderConfig class or configuring Entity Framework provider with a config file see the following topics: