Skip to main content

DataViewExtensionBase.BindToEF(Type, String, EventHandler<LinqServerModeDataSourceSelectEventArgs>) Method

Binds the DataView to a data source via the Entity Framework.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public DataViewExtensionBase BindToEF(
    Type contextType,
    string tableName,
    EventHandler<LinqServerModeDataSourceSelectEventArgs> selectingMethod
)

Parameters

Name Type Description
contextType Type

A Type specifying the DataContext type.

tableName String

A String object specifying the table name.

selectingMethod EventHandler<LinqServerModeDataSourceSelectEventArgs>

A method to which selection logic is delegated.

Returns

Type Description
DataViewExtensionBase

A DataViewExtensionBase object representing the DataView extension.

Remarks

Note

The current BindToEF overload catches and conceals any exception thrown by an EF data provider. To catch these exceptions manually, use the BindToEF(string contextTypeName, string tableName, EventHandler<LinqServerModeDataSourceSelectEventArgs> selectingMethod, EventHandler<ServerModeExceptionThrownEventArgs> exceptionThrownMethod) overload method.

See Also