EntityCoreDataSource Component Overview
The EntityCoreDataSource component was introduced with 2026 Q2 (20.1.26.520).
The EntityCoreDataSource component allows you to connect report data items to an Entity Framework Core DbContext. It exposes business objects defined in EF Core models directly, without intermediate object data sources or hand-written code in code-behind.
The component is available both in the Standalone Report Designer (.NET) and the Web Report Designer under the toolbox label Entity Framework Core Data Source.
If your project targets .NET Framework, use the EntityDataSource component instead. If you are migrating from EntityDataSource, the two components expose the same
Context,ContextMember,ConnectionString, andParametersproperties, so your existing configuration carries over.
Key Capabilities
- Dedicated design-time support: the component includes a dedicated toolbox item and a wizard in both the Standalone Report Designer (.NET) and the Web Report Designer. The wizard guides you through selecting a
DbContext, choosing the entity member to expose as the data source, and configuring the parameters. After the wizard completes, the Data Explorer shows the entity schema so you can drag fields directly onto report items. The last wizard step lets you preview live data before finishing. DbContextbinding: set the data source to aDbContextand specify which entity set, property, or method provides the report data. The wizard handles this through a selection UI; in code, setContextandContextMemberdirectly or use the relevant constructor.- Connection-string injection: configure which database connection the data source uses. Set it through the wizard, via the
ConnectionStringproperty in code, or as the first argument of theEntityCoreDataSource(connectionString, context, contextMember)constructor. - Parameter passing: add entries to the
Parameterscollection to invoke parameterized methods or queryable projections on theDbContext. - Shared Data Source reuse: in the Web Report Designer, extract the created
EntityCoreDataSourcecomponent to a Shared Data Source and reuse the same configuration across multiple reports.
Public API
The component exposes three constructor overloads and three serializable properties:
namespace Telerik.Reporting
{
public class EntityCoreDataSource : EntityDataSourceBase
{
public EntityCoreDataSource();
public EntityCoreDataSource(object context, string contextMember);
public EntityCoreDataSource(string connectionString, object context, string contextMember);
// Inherited from EntityDataSourceBase:
public string ConnectionString { get; set; }
public object Context { get; set; } // DbContext type or instance
public string ContextMember { get; set; } // DbSet<T> or method/property name
}
}
The Parameters collection is available through the inherited ObjectDataSourceBase class. Use Add(name, type, valueOrExpression) to add entries.
DbContext Requirements
To consume a DbContext with the EntityCoreDataSource component, the type must satisfy the following requirements:
-
Assembly accessibility: the assembly that contains your
DbContextmust be accessible wherever the report runs:- Your application (runtime): add the
DbContextclass library as a project reference and register it undertelerikReporting.assemblyReferencesinappsettings.json. - Standalone Report Designer (.NET): extend the designer to recognize the assembly. The EF Core runtime and database provider assemblies must be copied manually to the designer folder. You can take them from the
binfolder of the project after building it. - Web Report Designer: add the assembly to the host application and register it under
telerikReporting.assemblyReferencesinappsettings.json.
Automatic resolution of transitive dependencies in the report designer is planned for a future release. Until then, copy the required assemblies manually.
- Your application (runtime): add the
-
The
DbContextis defined in a class library that is referenced by the report project so that the report designer can load the type. -
The
DbContextexposes the entity sets you want to report on asDbSet<T>properties, or projects them throughIQueryable<T>properties. -
The
DbContextexposes a parameterless constructor and either a constructor that accepts a connection string (typical for the Code First approach) or a constructor that accepts aDbContextOptions<TContext>(typical for the Database First approach). A constructor that accepts astringis required when the design-time and runtime connection strings differ, because the component invokes it after assigning the value ofConnectionString.
The following snippets show the minimal DbContext shape that the component can consume:
-
Code First scenario:
C#public class AppDbContext : DbContext { public AppDbContext() { } public AppDbContext(string connectionString) : base(BuildOptions(connectionString)) { } public DbSet<Person> People => Set<Person>(); private static DbContextOptions<AppDbContext> BuildOptions(string connectionString) { return new DbContextOptionsBuilder<AppDbContext>() .UseSqlServer(connectionString) .Options; } } -
Database First scenario:
C#public class AppDbContext : DbContext { public AppDbContext() { } public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { } public DbSet<Person> People => Set<Person>(); protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured) { // Replace the literal below with your own connection string or // resolve it from configuration before calling UseSqlServer. optionsBuilder.UseSqlServer("<your connection string>"); } } }
Supported Developer Platforms
- .NET 8 and later
Next Steps
- Connecting to a DbContext with the EntityCoreDataSource Component
- Using Parameters with the EntityCoreDataSource Component
- Configuring the Database Connectivity with the EntityCoreDataSource Component
- Maintaining the Lifecycle of the Context with the EntityCoreDataSource Component