Skip to main content
net8.0

An adapter for using the Fluent UI Blazor DataGrid with Entity Framework.

Published
Nov 28, 2023
2y ago
Total Downloads
305.8K
305,846

Install

dotnet add package Microsoft.FluentUI.AspNetCore.Components.DataGrid.EntityFrameworkAdapter --version 4.1.0
ProductVersions
.NET
net8.0

README

About

Use this package if the data you want to display in the FluentDataGrid (component in the Microsoft.FluentUI.AspNetCore.Components library) comes from EF Core:

EF Core's DataContext gives you a DbSet property for each table in your database. Simply supply this as the grid's RowsData parameter:

@inject ApplicationDbContext MyDbContext

<FluentDataGrid RowsData="@MyDbContext.People">
    ...
</FluentDataGrid>

You may also use any EF-supported LINQ operator to filter the data before passing it:

@inject ApplicationDbContext MyDbContext

<FluentDataGrid RowsData="@MyDbContext.Documents.Where(d => d.CategoryId == currentCategoryId)">
    ...
</FluentDataGrid>

The FluentDataGrid recognizes EF-supplied IQueryable instances and knows how to resolve queries asynchronously for efficiency.

Installation

Install the package by running the command:

dotnet add package Microsoft.FluentUI.AspNetCore.Components.DataGrid.EntityFrameworkAdapter

Usage

In your Program.cs file you need to add the following:

builder.Services.AddDataGridEntityFrameworkAdapter();

Changes from Previous Version

No structural changes between v4.0.0 and v4.1.0.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.