[EFCore] Different UseNonUnicodeStrings settings within one application
Posted: Fri 06 Jan 2017 15:46
There exists an option 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
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.
Code: Select all
Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance.CodeFirstOptions.UseNonUnicodeStringsThe 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