[EFCore] Different UseNonUnicodeStrings settings within one application

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
azabluda
Posts: 35
Joined: Thu 10 Sep 2009 14:45

[EFCore] Different UseNonUnicodeStrings settings within one application

Post by azabluda » Fri 06 Jan 2017 15:46

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.

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

Re: [EFCore] Different UseNonUnicodeStrings settings within one application

Post by Shalex » Tue 10 Jan 2017 12:10

Thank you for your suggestion. We will put this feature on our roadmap and notify you when it is implemented.

Post Reply