I can create a PgSqlConnection as follows:
Code: Select all
PgSqlConnection pgConnection = new PgSqlConnection();
pgConnection.Host = "192.168.1.6";
...
But instead I'd like to re-use the Connection that is created as part of the Devart Entity Model I generated from my DB (and already has a connection-string defined).
Something like this:
Code: Select all
using (var context = new iCModel.iCEntities())
{
PgSqlConnection pgConnection = (PgSqlConnection)context.Connection;
However, this doesn't work because these types don't cast. Is there a way to get a connection using the generated classes?
Thanks,