Page 1 of 1
How to set ClientInfo using Entity Framework?
Posted: Tue 27 Nov 2018 12:35
by cew3
Hi there!
How do I set the ClientInfo using EF as I could do using an OracleConnection?
Could it be set in the connection string?
Best regards,
cew3
Re: How to set ClientInfo using Entity Framework?
Posted: Thu 29 Nov 2018 20:03
by Shalex
There is the ClientId parameter in connection string:
https://www.devart.com/dotconnect/oracl ... tring.html. Is that what you need?
Re: How to set ClientInfo using Entity Framework?
Posted: Fri 30 Nov 2018 10:21
by cew3
You're right. There is a parameter ClientId. But as described in:
https://www.devart.com/dotconnect/oracl ... mbers.html
- ClientId:
This property specifies the client identifier for the connection. It helps to make audition of the client connections and gives an opportunity to distinguish between the applications connecting to.
- ClientInfo:
Gets or sets the client information for the connection.
there is also a parameter
ClientInfo I have to set using Entity Framework.
Best regards,
cew3
Re: How to set ClientInfo using Entity Framework?
Posted: Tue 11 Dec 2018 13:38
by cew3
Hello?
Anybody out there?
Re: How to set ClientInfo using Entity Framework?
Posted: Wed 12 Dec 2018 16:08
by Shalex
You are working with EF4 and ObjectContext, aren't you?
Please use this approach:
Code: Select all
using (var myObjectContext = new MyEntities())
{
var conn = (myObjectContext.Connection as System.Data.EntityClient.EntityConnection).StoreConnection as OracleConnection;
conn.Open();
conn.ClientInfo = "abcd";
// work with myObjectContext
conn.Close();
}