CodeFirstOptions.ColumnTypeCasingConventionCompatibility

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Dennis Wanke
Posts: 57
Joined: Tue 11 Mar 2014 07:49

CodeFirstOptions.ColumnTypeCasingConventionCompatibility

Post by Dennis Wanke » Thu 24 Apr 2014 09:08

Our product uses both EF "Model First" and "Code First" approaches simultaneously. In order "Code First" parts can work with dotConnect for Oracle, we have to explicitly remove ColumnTypeCasingConvention for every DbContexts in the application. Istead, we would like to just set the ColumnTypeCasingConventionCompatibility option to "true" for the entire application - but we can't, since it breaks the "Model First" parts (causing ObjectContext to fail with errors like "The type NVARCHAR2 is not qualified with a namespace or alias").
Even though this behavior is documented, the option is pretty useless in such "mixed" scenarios. Is there any chance to make the option affect only Code First logic (DbContexts) - as the name of its its section implies (CodeFirstOptions), leaving "Model First" bits (ObjectContext) intact?

P.S. This forum post http://forums.devart.com/viewtopic.php? ... patibility seems to describe the similar problem, that apparently have already been fixed, but in fact it is not.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: CodeFirstOptions.ColumnTypeCasingConventionCompatibility

Post by Shalex » Mon 28 Apr 2014 08:23

We have answered you by e-mail.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: CodeFirstOptions.ColumnTypeCasingConventionCompatibility

Post by Shalex » Fri 16 May 2014 11:10

The functionality of setting the CodeFirstOptions.ColumnTypeCasingConventionCompatibility option via provider manifest token for a particular Entity Framework model is implemented for possibility of using both Database-First/Model-First model with XML mapping and Code-First model with fluent/attribute mapping in the same AppDomain.

With the new (8.3.161) build of dotConnect for Oracle, the feature should used in the following way:

1) for Code-First model with fluent/attribute mapping, set ColumnTypeCasingConventionCompatibility to True in the code

Code: Select all

var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
config.CodeFirstOptions.ColumnTypeCasingConventionCompatibility = true;
or in *.config file of the application

2) for Database-First/Model-First model with XML mapping, edit edmx/edml file with XML Editor and add information about ColumnTypeCasingConventionCompatibility in provider manifest token. For example:

a) before a change

Code: Select all

ProviderManifestToken="Oracle, 11.2.0.1"
b) after the change

Code: Select all

ProviderManifestToken="Oracle, 11.2.0.1; CodeFirstOptions.ColumnTypeCasingConventionCompatibility=False;"
For more information about the new build, please refer to http://forums.devart.com/viewtopic.php?f=1&t=29592.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: CodeFirstOptions.ColumnTypeCasingConventionCompatibility

Post by Shalex » Fri 31 Oct 2014 10:35

Shalex wrote:for Database-First/Model-First model with XML mapping, edit edmx/edml file with XML Editor and add information about ColumnTypeCasingConventionCompatibility in provider manifest token
It is better to add ";CodeFirstOptions.ColumnTypeCasingConventionCompatibility=False" in ProviderManifestToken via interface of Entity Developer (the Provider Manifest Token property of EntityContextModel). This will allow not to overwrite the setting when modifying/saving model in future.

Post Reply