C# Class IdeaBlade.Drivers.DevForceLINQPadDriver

A LINQPad driver for DevForce entity models. This driver is based on the UniversalStaticDriver sample from LINQPad. LINQPad will new a "context", your EntityManager, each time a query is run. It will also use (at least) one AppDomain per query tab. You'll sometimes see a new AppDomain has been created when you least expect it - so watch out. It' important to not lock the model assembly - one of the nice features of LINQPad is that you can change your model and rebuild without the assembly being locked, and LINQPad will also (eventually) refresh to show your model changes. This driver does not have any static references to DevForce assemblies - but it does use reflection to load them.
Inheritance: LINQPad.Extensibility.DataContext.StaticDataContextDriver
ファイルを表示 Open project: IdeaBlade/DevForce.Utilities

Private Properties

Property Type Description
EnableSqlLogging bool
InitializeLogger void

Public Methods

Method Description
AreRepositoriesEquivalent ( IConnectionInfo c1, IConnectionInfo c2 ) : bool
GetAssembliesToAdd ( ) : IEnumerable

Add DevForce assemblies.

GetConnectionDescription ( IConnectionInfo cxInfo ) : string
GetContextConstructorArguments ( IConnectionInfo cxInfo ) : object[]

We're using the parameterless EM constructor, so no constructor arguments are provided.

GetContextConstructorParameters ( IConnectionInfo cxInfo ) : ParameterDescriptor[]

Use the default parameterless EntityManager constructor. After construction we can set some EM properties in the InitializeContext method.

GetCustomDisplayMemberProvider ( object objectToWrite ) : LINQPad.ICustomMemberProvider

To avoid walking the entire entity graph we use a custom provider.

GetNamespacesToAdd ( ) : IEnumerable

Add DevForce namespaces.

GetNamespacesToRemove ( ) : IEnumerable

Remove the default Linq to SQL namespaces.

GetSchema ( IConnectionInfo cxInfo, Type customType ) : List

Returns the schema for the EntityManager, showing EntityQueries and sprocs.

InitializeContext ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager ) : void

This is called after the EM is constructed.

OnQueryFinishing ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager ) : void

Populate SQL tab if sql logging is wanted.

ShowConnectionDialog ( IConnectionInfo cxInfo, bool isNewConnection ) : bool

This opens the standard connection dialog (heavily based on the Universal demo driver).

Private Methods

Method Description
EnableSqlLogging ( IConnectionInfo cxinfo ) : bool
InitializeLogger ( IConnectionInfo cxinfo ) : void

Method Details

AreRepositoriesEquivalent() public method

public AreRepositoriesEquivalent ( IConnectionInfo c1, IConnectionInfo c2 ) : bool
c1 IConnectionInfo
c2 IConnectionInfo
return bool

GetAssembliesToAdd() public method

Add DevForce assemblies.
public GetAssembliesToAdd ( ) : IEnumerable
return IEnumerable

GetConnectionDescription() public method

public GetConnectionDescription ( IConnectionInfo cxInfo ) : string
cxInfo IConnectionInfo
return string

GetContextConstructorArguments() public method

We're using the parameterless EM constructor, so no constructor arguments are provided.
public GetContextConstructorArguments ( IConnectionInfo cxInfo ) : object[]
cxInfo IConnectionInfo
return object[]

GetContextConstructorParameters() public method

Use the default parameterless EntityManager constructor. After construction we can set some EM properties in the InitializeContext method.
public GetContextConstructorParameters ( IConnectionInfo cxInfo ) : ParameterDescriptor[]
cxInfo IConnectionInfo
return ParameterDescriptor[]

GetCustomDisplayMemberProvider() public method

To avoid walking the entire entity graph we use a custom provider.
public GetCustomDisplayMemberProvider ( object objectToWrite ) : LINQPad.ICustomMemberProvider
objectToWrite object
return LINQPad.ICustomMemberProvider

GetNamespacesToAdd() public method

Add DevForce namespaces.
public GetNamespacesToAdd ( ) : IEnumerable
return IEnumerable

GetNamespacesToRemove() public method

Remove the default Linq to SQL namespaces.
public GetNamespacesToRemove ( ) : IEnumerable
return IEnumerable

GetSchema() public method

Returns the schema for the EntityManager, showing EntityQueries and sprocs.
public GetSchema ( IConnectionInfo cxInfo, Type customType ) : List
cxInfo IConnectionInfo
customType System.Type
return List

InitializeContext() public method

This is called after the EM is constructed.
public InitializeContext ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager ) : void
cxInfo IConnectionInfo
context object
executionManager LINQPad.Extensibility.DataContext.QueryExecutionManager
return void

OnQueryFinishing() public method

Populate SQL tab if sql logging is wanted.
public OnQueryFinishing ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager ) : void
cxInfo IConnectionInfo
context object
executionManager LINQPad.Extensibility.DataContext.QueryExecutionManager
return void

ShowConnectionDialog() public method

This opens the standard connection dialog (heavily based on the Universal demo driver).
public ShowConnectionDialog ( IConnectionInfo cxInfo, bool isNewConnection ) : bool
cxInfo IConnectionInfo
isNewConnection bool
return bool