A newer version of this page is available. Switch to the current version.

EFDataSource.BeforeLoadCustomAssembly Event

Occurs on an attempt to load a custom assembly by EFDataSource.

Namespace: DevExpress.DataAccess.EntityFramework

Assembly: DevExpress.DataAccess.v18.2.dll

Declaration

public event BeforeLoadCustomAssemblyEventHandler BeforeLoadCustomAssembly
Public Event BeforeLoadCustomAssembly As BeforeLoadCustomAssemblyEventHandler

Event Data

The BeforeLoadCustomAssembly event's data class is BeforeLoadCustomAssemblyEventArgs. The following properties provide information specific to this event:

Property Description
AllowLoading Specifies whether loading a custom assembly is allowed.
AssemblyPath Specifies the path to a requested assembly.
ContextName Specifies the type to load from a custom assembly.

Remarks

Loading of custom assemblies that may be referenced by Entity Framework data sources is forbidden by default.

To permit loading a specific assembly, handle the BeforeLoadCustomAssembly event (or static EFDataSource.BeforeLoadCustomAssemblyGlobal event) and specify the following properties of the BeforeLoadCustomAssemblyEventArgs object.

An unauthorized attempt to load a custom assembly will result in throwing a CustomAssemblyLoadingProhibitedException.

In the Data Source wizard, the corresponding option is disabled so that end-users are only allowed to select a data context from assemblies referenced by the project.

how-to-ef-datasource03a

To make the Browse button visible, set the EFWizardSettings.ShowBrowseButton property to true.

how-to-ef-datasource03

See Also