3 Using the Data Provider with the ADO.NET Entity Framework : Extending Entity Framework Functionality

Extending Entity Framework Functionality
The Entity Framework offers powerful productivity gains by masking many ADO.NET features, simplifying application development. DataDirect Connect for ADO.NET Entity Framework data providers include functionality designed to optimize performance.
Configuration Options
The Entity Framework data provider defines options that configure performance and specific behaviors. These options exist in the machine.config, app.config, and/or the web.config file.
The product installer specifies default values for the Visual Studio 2008 and Visual Studio 2010 app.config and the EdmGen app.config files. If necessary, you can alter the default values in the configuration files, for example, to enable the use of the Enterprise Library Logging Application Block.
The performance and behavior of the EdmGen and Visual Studio tools, when using the Entity Framework data provider to create and manipulate ADO.NET Entity Data Models, can be affected by the data provider configuration options. For example, setting EdmSchemaRestrictions to User can improve performance, but may not display all the database objects that you need for your entity model.
Specifying Data Provider Version Information in the .config File
To accomodate differences between earlier releases of the Entity Framework data provider, you can specify versioned configuration options in the configuration files. By default, non-versioned configuration entries apply to the latest release installed. Configuration options applicable to older releases must contain a version-specific identifer.
Suppose you have installed both Release 3.5 and Release 3.3 of the Oracle Entity Framework data provider. In the following example, the value of the EdmSchemaRestrictions configuration option is set to User for Release 3.3, and to Accessible for Release 3.5.
<ddtek.oracle.entity.3.3
   EdmSchemaRestrictions="User"
/>
<ddtek.oracle.entity
   EdmSchemaRestrictions="Accessible"
/>
Specifying Enterprise Library Version Information in the .config File
You can specify in the .config file which version of the Enterprise Library that you want to use. By default, the data providers are configured to use Enterprise Library 5.0. However, if want to continue using Enterprise Library 4.1 (October 2008), you can do so by modifying the .config file.
For example, to target the Enterprise Library 4.1 Logging Application Block, add the following entry:
<ddtek.db2.entity LABAssemblyName="Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
Designing an Entity Data Model
Building large models with the Entity Data Model (EDM) can be very inefficient. For optimal results, consider breaking up a model when it has reached 50 to 100 entities. In addition, carefully consider which objects are actually needed in the model.
To restrict or expand the database objects available to you when generating a model, use the EdmSchemaRestrictions configuration option. The option filters the schema objects that are returned when building the EDM that your application includes. Restricting the objects can also provide a performance improvement.
The following configuration option entry for the Oracle Entity Framework data provider limits the objects available for the model to those for which the current user is the owner:
<ddtek.oracle.entity
      EdmSchemaRestrictions="User"
     />  
Refer to DataDirect Connect for ADO.NET User’s Guide for information for your Entity Framework data provider.
Logging Application Block Support
Applications that use the standard Logging Application Block (LAB) from the Microsoft Enterprise Library Version 5.0 or Version 4.1 (October 2008) and the related design patterns can quickly display the SQL generated as part of the DataDirect Connect data providers for ADO.NET Entity Framework.
For more information, see “Logging Application Blocks”.