Retrieves a profiling wrapped EntityConnection. Call from the ObjectContext constructor.

Namespace: HuagatiEFProfiler
Assembly: HuagatiEFProfiler (in HuagatiEFProfiler.dll) Version: 1.33.3996.16092

Syntax

C#
public static EntityConnection GetConnection(
	bool enableProfiling,
	string connectionString
)
Visual Basic
Public Shared Function GetConnection ( _
	enableProfiling As Boolean, _
	connectionString As String _
) As EntityConnection
Visual C++
public:
static EntityConnection^ GetConnection(
	bool enableProfiling, 
	String^ connectionString
)

Parameters

enableProfiling
Type: System..::..Boolean
true to enable profiling, false to not
connectionString
Type: System..::..String
EntityConnection string

Return Value

An EntityConnection instance

Examples

CopyC#
public AdventureWorksEntities(bool enableProfiling, string connectionString)
    : this(HuagatiEFProfiler.EFProfiler.GetConnection(enableProfiling, connectionString))
{
    //log to the user's personal directory, under L2SProfiler\Samples
    string profilerOutput = System.IO.Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.Personal), @"L2SProfiler\Samples");

    _profiler = new HuagatiEFProfiler.EFProfiler(this, profilerOutput, null, HuagatiEFProfiler.ExecutionPlanMode.Actual, false);
}

See Also