DashboardEFDataSource Class

An Entity Framework data source that provides data for the dashboard.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v18.2.Core.dll

Declaration

public class DashboardEFDataSource :
    EFDataSource,
    IDashboardDataSource,
    IDashboardComponent,
    IComponent,
    IDisposable,
    ISupportInitialize,
    ISupportPrefix,
    IDashboardDataSourceInternal,
    IExternalSchemaConsumer
Public Class DashboardEFDataSource
    Inherits EFDataSource
    Implements IDashboardDataSource,
               IDashboardComponent,
               IComponent,
               IDisposable,
               ISupportInitialize,
               ISupportPrefix,
               IDashboardDataSourceInternal,
               IExternalSchemaConsumer

Depending on whether the Entity Framework model is added to the current project or is contained in an external assembly, you can create the DashboardEFDataSource data source in two ways.

Use the EFDataSource.Fill method to retrieve data from the data source.

Note

DashboardEFDataSource supports the following Entity Framework versions:

  • Entity Framework 5.0 and higher.
  • Entity Framework Core 1.0 and higher.

Note that the Entity Framework context class passed to an EFConnectionParameters.Source should be public.

Note

To connect to different database types using DashboardEFDataSource, you need to install a corresponding data provider. For instance, install the System.Data.SQLite.EF6 data provider to connect to an SQLite database using Entity Framework 6.

Examples

The following example demonstrates how to bind a dashboard to the SQLite database using Entity Framework 6.

In this example, the DashboardEFDataSource class is used to connect the dashboard to the Entity Framework data source.

Imports System.Data.Entity
Imports System

Namespace Dashboard_EntityFramework

    Partial Public Class OrdersContext
        Inherits DbContext

        Public Sub New()
            MyBase.New("name=OrdersContext")
        End Sub
        Public Overridable Property Orders() As DbSet(Of Order)
    End Class

    Partial Public Class Order
        Public Property OrderID() As Long
        Public Property CustomerID() As String
        Public Property EmployeeID() As Long?
        Public Property OrderDate() As Date?
        Public Property RequiredDate() As Date?
        Public Property ShippedDate() As Date?
        Public Property ShipVia() As Long?
        Public Property Freight() As Decimal?
        Public Property ShipName() As String
        Public Property ShipAddress() As String
        Public Property ShipCity() As String
        Public Property ShipRegion() As String
        Public Property ShipPostalCode() As String
        Public Property ShipCountry() As String
    End Class
End Namespace

Inheritance

Object
DashboardEFDataSource

See Also