Page 1 of 1

[EFCore] Different UseNonUnicodeStrings settings within one application

Posted: Fri 06 Jan 2017 15:46
by azabluda
There exists an option

Code: Select all

Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance.CodeFirstOptions.UseNonUnicodeStrings
which controls the default database column type used for string properties (when no .HasColumnType is explicitly specified in the model builder).

The fact that OracleEntityProviderConfig is a singleton makes it problematic to configure the behavior differently within one application (e.g. when talking to two different databases) or to run some specific automated tests in parallel. UseNonUnicodeStrings flag is just one example, OracleEntityProviderConfig contains many other options which today can only be set globally.

Proposal: add optional parameter

Code: Select all

OracleEntityProviderConfig providerConfig
to DbContextOptionsBuilder.UseOracle (or at least to OracleOptionsExtension class) to make it possible to configure the provider differently for different instances of DbContext (or at least for different service collections). Static OracleEntityProviderConfig.Instance can still be used by default for backward compatibility.

Re: [EFCore] Different UseNonUnicodeStrings settings within one application

Posted: Tue 10 Jan 2017 12:10
by Shalex
Thank you for your suggestion. We will put this feature on our roadmap and notify you when it is implemented.