Getting a reference to OracleConnection
Posted: Thu 17 Jul 2014 22:05
I am trying to set the ClientId connection attribute which was added to OracleConnection.
I've spent hours trying to figure out how to get a reference to OracleConnection to set this property but I can't find any documentation.
Since I am using Entity Framework, the connection is not instantiated in code. Just a section in web.config.
and then I just configure the DbContext
and all the EF code is applied to an instance of Db() class.
Somehow I need to get an instance to OracleConnection, to set the ClientId property so that it is used in all of the queries. How can this be done?
I've spent hours trying to figure out how to get a reference to OracleConnection to set this property but I can't find any documentation.
Since I am using Entity Framework, the connection is not instantiated in code. Just a section in web.config.
Code: Select all
<Devart.Data.Oracle.Entity xmlns="http://devart.com/schemas/Devart.Data.Oracle.Entity/1.0">
<CodeFirstOptions ColumnTypeCasingConventionCompatibility="true" />
</Devart.Data.Oracle.Entity>
Code: Select all
public class Db : DbContext
protected override void OnModelCreating(DbModelBuilder modelBuilder){...}
Somehow I need to get an instance to OracleConnection, to set the ClientId property so that it is used in all of the queries. How can this be done?