From 076bf5ec43e2d7c0c1803301eb6137bc73b78bdb Mon Sep 17 00:00:00 2001 From: guardrex <1622880+guardrex@users.noreply.github.com> Date: Thu, 30 Mar 2023 08:30:21 -0400 Subject: [PATCH 1/4] Blazor QuickGrid article --- .../blazor/components/built-in-components.md | 4 +- aspnetcore/blazor/components/index.md | 138 ----------------- aspnetcore/blazor/components/quickgrid.md | 143 ++++++++++++++++++ aspnetcore/release-notes/aspnetcore-7.0.md | 2 +- aspnetcore/toc.yml | 2 + 5 files changed, 148 insertions(+), 141 deletions(-) create mode 100644 aspnetcore/blazor/components/quickgrid.md diff --git a/aspnetcore/blazor/components/built-in-components.md b/aspnetcore/blazor/components/built-in-components.md index bd29d0741a50..9993121a643e 100644 --- a/aspnetcore/blazor/components/built-in-components.md +++ b/aspnetcore/blazor/components/built-in-components.md @@ -5,7 +5,7 @@ description: Find information on Razor components provided by the Blazor framewo monikerRange: '>= aspnetcore-3.1' ms.author: riande ms.custom: mvc -ms.date: 11/08/2022 +ms.date: 03/30/2023 uid: blazor/components/built-in-components --- # ASP.NET Core built-in Razor components @@ -39,7 +39,7 @@ The following built-in Razor components are provided by the Blazor framework: * [`NavLink`](xref:blazor/fundamentals/routing#navlink-and-navmenu-components) * [`NavMenu`](xref:blazor/fundamentals/routing#navlink-and-navmenu-components) * [`PageTitle`](xref:blazor/components/control-head-content) -* [`QuickGrid`](xref:blazor/components/index#quickgrid-component) +* [`QuickGrid`](xref:blazor/components/quickgrid) * [`Router`](xref:blazor/fundamentals/routing#route-templates) * [`RouteView`](xref:blazor/fundamentals/routing#route-templates) * [`Virtualize`](xref:blazor/components/virtualization) diff --git a/aspnetcore/blazor/components/index.md b/aspnetcore/blazor/components/index.md index 2b00c5756fe2..74f5b4632c78 100644 --- a/aspnetcore/blazor/components/index.md +++ b/aspnetcore/blazor/components/index.md @@ -1472,144 +1472,6 @@ For more information, see the following resources: * * -## `QuickGrid` component - -:::moniker-end - -:::moniker range=">= aspnetcore-8.0" - -The `QuickGrid` component is a Razor component for quickly and efficiently displaying data in tabular form. `QuickGrid` provides a simple and convenient data grid component for common grid rendering scenarios and serves as a reference architecture and performance baseline for building data grid components. `QuickGrid` is highly optimized and uses advanced techniques to achieve optimal rendering performance. - -To implement a `QuickGrid` component: - -* Specify tags for the `QuickGrid` component in Razor markup (`...`). -* Name a queryable source of data for the grid. Use ***either*** of the following data sources: - * `Items`: A nullable `IQueryable`, where `TGridItem` is the type of data represented by each row in the grid. - * `ItemsProvider`: A callback that supplies data for the grid. -* `Class`: An optional CSS class name. If provided, the class name is included in the `class` attribute of the rendered table. -* `Theme`: A theme name (default value: `default`). This affects which styling rules match the table. -* `Virtualize`: If true, the grid is rendered with virtualization. This is normally used in conjunction with scrolling and causes the grid to fetch and render only the data around the current scroll viewport. This can greatly improve the performance when scrolling through large data sets. If you use `Virtualize`, you should supply a value for `ItemSize` and must ensure that every row renders with a constant height. Generally, it's preferable not to use `Virtualize` if the amount of data rendered is small or if you're using pagination. -* `ItemSize`: Only applicable when using `Virtualize`. `ItemSize` defines an expected height in pixels for each row, allowing the virtualization mechanism to fetch the correct number of items to match the display size and to ensure accurate scrolling. -* `ItemKey`: Optionally defines a value for `@key` on each rendered row. Typically, this is used to specify a unique identifier, such as a primary key value, for each data item. This allows the grid to preserve the association between row elements and data items based on their unique identifiers, even when the `TGridItem` instances are replaced by new copies (for example, after a new query against the underlying data store). If not set, the `@key` is the `TGridItem` instance. -* `Pagination`: Optionally links this `QuickGrid{TGridItem}` instance with a `PaginationState` model, causing the grid to fetch and render only the current page of data. This is normally used in conjunction with a `Paginator` component or some other UI logic that displays and updates the supplied `PaginationState` instance. -* In the `QuickGrid` child content (), specify `PropertyColumn`s, which represent `QuickGrid{TGridItem}` columns whose cells display values: - * `Property`: Defines the value to be displayed in this column's cells. - * `Format`: Optionally specifies a format string for the value. Using `Format` requires the `TProp` type to implement `IFormattable`. - * `Sortable`: Indicates whether the data should be sortable by this column. The default value may vary according to the column type. For example, a `TemplateColumn{TGridItem}` is sortable by default if any `TemplateColumn{TGridItem}.SortBy` parameter is specified. - * `InitialSortDirection`: Indicates which direction to sort in if `IsDefaultSortColumn` is `true`. - * `IsDefaultSortColumn`: Indicates whether this column should be sorted by default. - * `PlaceholderTemplate`: If specified, virtualized grids use this template to render cells whose data hasn't been loaded. - -For example, add the following component to render a grid. - -`Pages/QuickGridExample.razor`: - -```razor -@page "/quickgrid-example" - - - - - - - -@code { - private record Person(int PersonId, string Name, DateOnly PromotionDate); - - private IQueryable people = new[] - { - new Person(10895, "Jean Martin", new DateOnly(1985, 3, 16)), - new Person(10944, "António Langa", new DateOnly(1991, 12, 1)), - new Person(11203, "Julie Smith", new DateOnly(1958, 10, 10)), - new Person(11205, "Nur Sari", new DateOnly(1922, 4, 27)), - new Person(11898, "Jose Hernandez", new DateOnly(2011, 5, 3)), - new Person(12130, "Kenji Sato", new DateOnly(2004, 1, 9)), - }.AsQueryable(); -} -``` - -For an example that uses an with Entity Framework Core as the queryable data source, see the [`SampleQuickGridComponent` component in the ASP.NET Core Basic Test App (`dotnet/aspnetcore` GitHub repository)](https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/testassets/BasicTestApp/QuickGridTest/SampleQuickGridComponent.razor). - -[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)] - -To use EF Core as the data source: - -* Add a package reference to the app for the [`Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter) package. - - [!INCLUDE[](~/includes/package-reference.md)] - -* Call `AddQuickGridEntityFrameworkAdapter` on the service collection in `Startup.ConfigureServices` of `Startup.cs` (Blazor Server) or `Program.cs` (Blazor WebAssembly) to register an EF-aware implementation of `IAsyncQueryExecutor`. - - * Blazor Server: - - ```csharp - services.AddQuickGridEntityFrameworkAdapter(); - ``` - - * Blazor WebAssembly: - - ```csharp - builder.Services.AddQuickGridEntityFrameworkAdapter(); - ``` - -:::moniker-end - -:::moniker range=">= aspnetcore-7.0 < aspnetcore-8.0" - -The `QuickGrid` component is an experimental Razor component for quickly and efficiently displaying data in tabular form. `QuickGrid` provides a simple and convenient data grid component for common grid rendering scenarios and serves as a reference architecture and performance baseline for building data grid components. `QuickGrid` is highly optimized and uses advanced techniques to achieve optimal rendering performance. - -To get started with `QuickGrid`: - -Add package reference for [`Microsoft.AspNetCore.Components.QuickGrid`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid). If using the .NET CLI to add the package reference, include the `--prerelease` option when you execute the [`dotnet add package` command](/dotnet/core/tools/dotnet-add-package). - -[!INCLUDE[](~/includes/package-reference.md)] - -Add the following component to render a grid. - -`Pages/QuickGridExample.razor`: - -```razor -@page "/quickgrid-example" -@using Microsoft.AspNetCore.Components.QuickGrid - - - - - - - -@code { - private record Person(int PersonId, string Name, DateOnly PromotionDate); - - private IQueryable people = new[] - { - new Person(10895, "Jean Martin", new DateOnly(1985, 3, 16)), - new Person(10944, "António Langa", new DateOnly(1991, 12, 1)), - new Person(11203, "Julie Smith", new DateOnly(1958, 10, 10)), - new Person(11205, "Nur Sari", new DateOnly(1922, 4, 27)), - new Person(11898, "Jose Hernandez", new DateOnly(2011, 5, 3)), - new Person(12130, "Kenji Sato", new DateOnly(2004, 1, 9)), - }.AsQueryable(); -} -``` - -:::moniker-end - -:::moniker range=">= aspnetcore-7.0" - -Access the component in a browser at the relative path `/quickgrid-example`. - -For various `QuickGrid` demonstrations, see the [**QuickGrid for Blazor** app](https://aspnet.github.io/quickgridsamples/). The demo site is built using Blazor WebAssembly and is hosted on GitHub Pages. The site loads fast thanks to static prerendering using the community-maintained [`BlazorWasmPrerendering.Build` GitHub project](https://github.com/jsakamoto/BlazorWasmPreRendering.Build). - -There aren't current plans to extend `QuickGrid` with features that full-blown commercial grids tend to offer, for example, hierarchical rows, drag-to-reorder columns, or Excel-like range selections. If you require advanced features that you don't wish to develop on your own, continue using third-party grids. - -:::moniker-end - -:::moniker range=">= aspnetcore-7.0 < aspnetcore-8.0" - -> [!WARNING] -> The `QuickGrid` component is in preview for ASP.NET Core 7.x. You're welcome to use it in production if it meets your needs, but it isn't officially supported until ASP.NET Core 8.0 or later. - :::moniker-end :::moniker range=">= aspnetcore-6.0 < aspnetcore-7.0" diff --git a/aspnetcore/blazor/components/quickgrid.md b/aspnetcore/blazor/components/quickgrid.md new file mode 100644 index 000000000000..37366ad48309 --- /dev/null +++ b/aspnetcore/blazor/components/quickgrid.md @@ -0,0 +1,143 @@ +--- +title: ASP.NET Core Blazor QuickGrid component +author: guardrex +description: The QuickGrid component is a Razor component for quickly and efficiently displaying data in tabular form. +monikerRange: '>= aspnetcore-7.0' +ms.author: riande +ms.custom: mvc +ms.date: 03/30/2023 +uid: blazor/components/quickgrid +--- +# ASP.NET Core Blazor `QuickGrid` component + +:::moniker range=">= aspnetcore-8.0" + +The `QuickGrid` component is a Razor component for quickly and efficiently displaying data in tabular form. `QuickGrid` provides a simple and convenient data grid component for common grid rendering scenarios and serves as a reference architecture and performance baseline for building data grid components. `QuickGrid` is highly optimized and uses advanced techniques to achieve optimal rendering performance. + +To implement a `QuickGrid` component: + +* Specify tags for the `QuickGrid` component in Razor markup (`...`). +* Name a queryable source of data for the grid. Use ***either*** of the following data sources: + * `Items`: A nullable `IQueryable`, where `TGridItem` is the type of data represented by each row in the grid. + * `ItemsProvider`: A callback that supplies data for the grid. +* `Class`: An optional CSS class name. If provided, the class name is included in the `class` attribute of the rendered table. +* `Theme`: A theme name (default value: `default`). This affects which styling rules match the table. +* `Virtualize`: If true, the grid is rendered with virtualization. This is normally used in conjunction with scrolling and causes the grid to fetch and render only the data around the current scroll viewport. This can greatly improve the performance when scrolling through large data sets. If you use `Virtualize`, you should supply a value for `ItemSize` and must ensure that every row renders with a constant height. Generally, it's preferable not to use `Virtualize` if the amount of data rendered is small or if you're using pagination. +* `ItemSize`: Only applicable when using `Virtualize`. `ItemSize` defines an expected height in pixels for each row, allowing the virtualization mechanism to fetch the correct number of items to match the display size and to ensure accurate scrolling. +* `ItemKey`: Optionally defines a value for `@key` on each rendered row. Typically, this is used to specify a unique identifier, such as a primary key value, for each data item. This allows the grid to preserve the association between row elements and data items based on their unique identifiers, even when the `TGridItem` instances are replaced by new copies (for example, after a new query against the underlying data store). If not set, the `@key` is the `TGridItem` instance. +* `Pagination`: Optionally links this `QuickGrid{TGridItem}` instance with a `PaginationState` model, causing the grid to fetch and render only the current page of data. This is normally used in conjunction with a `Paginator` component or some other UI logic that displays and updates the supplied `PaginationState` instance. +* In the `QuickGrid` child content (), specify `PropertyColumn`s, which represent `QuickGrid{TGridItem}` columns whose cells display values: + * `Property`: Defines the value to be displayed in this column's cells. + * `Format`: Optionally specifies a format string for the value. Using `Format` requires the `TProp` type to implement `IFormattable`. + * `Sortable`: Indicates whether the data should be sortable by this column. The default value may vary according to the column type. For example, a `TemplateColumn{TGridItem}` is sortable by default if any `TemplateColumn{TGridItem}.SortBy` parameter is specified. + * `InitialSortDirection`: Indicates which direction to sort in if `IsDefaultSortColumn` is `true`. + * `IsDefaultSortColumn`: Indicates whether this column should be sorted by default. + * `PlaceholderTemplate`: If specified, virtualized grids use this template to render cells whose data hasn't been loaded. + +For example, add the following component to render a grid. + +`Pages/QuickGridExample.razor`: + +```razor +@page "/quickgrid-example" + + + + + + + +@code { + private record Person(int PersonId, string Name, DateOnly PromotionDate); + + private IQueryable people = new[] + { + new Person(10895, "Jean Martin", new DateOnly(1985, 3, 16)), + new Person(10944, "António Langa", new DateOnly(1991, 12, 1)), + new Person(11203, "Julie Smith", new DateOnly(1958, 10, 10)), + new Person(11205, "Nur Sari", new DateOnly(1922, 4, 27)), + new Person(11898, "Jose Hernandez", new DateOnly(2011, 5, 3)), + new Person(12130, "Kenji Sato", new DateOnly(2004, 1, 9)), + }.AsQueryable(); +} +``` + +For an example that uses an with Entity Framework Core as the queryable data source, see the [`SampleQuickGridComponent` component in the ASP.NET Core Basic Test App (`dotnet/aspnetcore` GitHub repository)](https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/testassets/BasicTestApp/QuickGridTest/SampleQuickGridComponent.razor). + +[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)] + +To use EF Core as the data source: + +* Add a package reference to the app for the [`Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter) package. + + [!INCLUDE[](~/includes/package-reference.md)] + +* Call `AddQuickGridEntityFrameworkAdapter` on the service collection in `Startup.ConfigureServices` of `Startup.cs` (Blazor Server) or `Program.cs` (Blazor WebAssembly) to register an EF-aware implementation of `IAsyncQueryExecutor`. + + * Blazor Server: + + ```csharp + services.AddQuickGridEntityFrameworkAdapter(); + ``` + + * Blazor WebAssembly: + + ```csharp + builder.Services.AddQuickGridEntityFrameworkAdapter(); + ``` + +:::moniker-end + +:::moniker range="< aspnetcore-8.0" + +The `QuickGrid` component is an experimental Razor component for quickly and efficiently displaying data in tabular form. `QuickGrid` provides a simple and convenient data grid component for common grid rendering scenarios and serves as a reference architecture and performance baseline for building data grid components. `QuickGrid` is highly optimized and uses advanced techniques to achieve optimal rendering performance. + +To get started with `QuickGrid`: + +Add package reference for [`Microsoft.AspNetCore.Components.QuickGrid`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid). If using the .NET CLI to add the package reference, include the `--prerelease` option when you execute the [`dotnet add package` command](/dotnet/core/tools/dotnet-add-package). + +[!INCLUDE[](~/includes/package-reference.md)] + +Add the following component to render a grid. + +`Pages/QuickGridExample.razor`: + +```razor +@page "/quickgrid-example" +@using Microsoft.AspNetCore.Components.QuickGrid + + + + + + + +@code { + private record Person(int PersonId, string Name, DateOnly PromotionDate); + + private IQueryable people = new[] + { + new Person(10895, "Jean Martin", new DateOnly(1985, 3, 16)), + new Person(10944, "António Langa", new DateOnly(1991, 12, 1)), + new Person(11203, "Julie Smith", new DateOnly(1958, 10, 10)), + new Person(11205, "Nur Sari", new DateOnly(1922, 4, 27)), + new Person(11898, "Jose Hernandez", new DateOnly(2011, 5, 3)), + new Person(12130, "Kenji Sato", new DateOnly(2004, 1, 9)), + }.AsQueryable(); +} +``` + +:::moniker-end + +Access the component in a browser at the relative path `/quickgrid-example`. + +There aren't current plans to extend `QuickGrid` with features that full-blown commercial grids tend to offer, for example, hierarchical rows, drag-to-reorder columns, or Excel-like range selections. If you require advanced features that you don't wish to develop on your own, continue using third-party grids. + +:::moniker range="< aspnetcore-8.0" + +For various `QuickGrid` demonstrations, see the [**QuickGrid for Blazor** app](https://aspnet.github.io/quickgridsamples/). The demo site is built using Blazor WebAssembly and is hosted on GitHub Pages. The site loads fast thanks to static prerendering using the community-maintained [`BlazorWasmPrerendering.Build` GitHub project](https://github.com/jsakamoto/BlazorWasmPreRendering.Build). + +> [!WARNING] +> The `QuickGrid` component is in preview for ASP.NET Core 7.x. You're welcome to use it in production if it meets your needs, but it isn't officially supported until ASP.NET Core 8.0 or later. + +:::moniker-end diff --git a/aspnetcore/release-notes/aspnetcore-7.0.md b/aspnetcore/release-notes/aspnetcore-7.0.md index 4867d26545e9..4458c1e23994 100644 --- a/aspnetcore/release-notes/aspnetcore-7.0.md +++ b/aspnetcore/release-notes/aspnetcore-7.0.md @@ -457,7 +457,7 @@ Several additional changes were made to the Blazor project templates. It isn't f The new `QuickGrid` component provides a convenient data grid component for most common requirements and as a reference architecture and performance baseline for anyone building Blazor data grid components. -For more information, see . +For more information, see . Live demo: [QuickGrid for Blazor sample app](https://aspnet.github.io/quickgridsamples/) diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index fed800242dcb..ac7dca86750a 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -451,6 +451,8 @@ items: uid: blazor/components/css-isolation - name: Dynamically-rendered components uid: blazor/components/dynamiccomponent + - name: QuickGrid component + uid: blazor/components/quickgrid - name: Prerender and integrate components uid: blazor/components/prerendering-and-integration - name: Class libraries From 371bca07b3f5adc0009f5a6809bc8cceb5050c54 Mon Sep 17 00:00:00 2001 From: guardrex <1622880+guardrex@users.noreply.github.com> Date: Thu, 30 Mar 2023 09:12:25 -0400 Subject: [PATCH 2/4] Updates --- aspnetcore/blazor/components/quickgrid.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/blazor/components/quickgrid.md b/aspnetcore/blazor/components/quickgrid.md index 37366ad48309..2ebd7121dcf2 100644 --- a/aspnetcore/blazor/components/quickgrid.md +++ b/aspnetcore/blazor/components/quickgrid.md @@ -25,12 +25,12 @@ To implement a `QuickGrid` component: * `Virtualize`: If true, the grid is rendered with virtualization. This is normally used in conjunction with scrolling and causes the grid to fetch and render only the data around the current scroll viewport. This can greatly improve the performance when scrolling through large data sets. If you use `Virtualize`, you should supply a value for `ItemSize` and must ensure that every row renders with a constant height. Generally, it's preferable not to use `Virtualize` if the amount of data rendered is small or if you're using pagination. * `ItemSize`: Only applicable when using `Virtualize`. `ItemSize` defines an expected height in pixels for each row, allowing the virtualization mechanism to fetch the correct number of items to match the display size and to ensure accurate scrolling. * `ItemKey`: Optionally defines a value for `@key` on each rendered row. Typically, this is used to specify a unique identifier, such as a primary key value, for each data item. This allows the grid to preserve the association between row elements and data items based on their unique identifiers, even when the `TGridItem` instances are replaced by new copies (for example, after a new query against the underlying data store). If not set, the `@key` is the `TGridItem` instance. -* `Pagination`: Optionally links this `QuickGrid{TGridItem}` instance with a `PaginationState` model, causing the grid to fetch and render only the current page of data. This is normally used in conjunction with a `Paginator` component or some other UI logic that displays and updates the supplied `PaginationState` instance. -* In the `QuickGrid` child content (), specify `PropertyColumn`s, which represent `QuickGrid{TGridItem}` columns whose cells display values: +* `Pagination`: Optionally links this `TGridItem` instance with a `PaginationState` model, causing the grid to fetch and render only the current page of data. This is normally used in conjunction with a `Paginator` component or some other UI logic that displays and updates the supplied `PaginationState` instance. +* In the `QuickGrid` child content (), specify `PropertyColumn`s, which represent `TGridItem` columns whose cells display values: * `Property`: Defines the value to be displayed in this column's cells. * `Format`: Optionally specifies a format string for the value. Using `Format` requires the `TProp` type to implement `IFormattable`. - * `Sortable`: Indicates whether the data should be sortable by this column. The default value may vary according to the column type. For example, a `TemplateColumn{TGridItem}` is sortable by default if any `TemplateColumn{TGridItem}.SortBy` parameter is specified. - * `InitialSortDirection`: Indicates which direction to sort in if `IsDefaultSortColumn` is `true`. + * `Sortable`: Indicates whether the data should be sortable by this column. The default value may vary according to the column type. For example, a `TemplateColumn` is sortable by default if any `TemplateColumn.SortBy` parameter is specified. + * `InitialSortDirection`: Indicates the sort direction if `IsDefaultSortColumn` is `true`. * `IsDefaultSortColumn`: Indicates whether this column should be sorted by default. * `PlaceholderTemplate`: If specified, virtualized grids use this template to render cells whose data hasn't been loaded. From ec35b4ad1ff7dbc2e2fa612c26dc0f4369f57652 Mon Sep 17 00:00:00 2001 From: guardrex <1622880+guardrex@users.noreply.github.com> Date: Thu, 30 Mar 2023 09:19:50 -0400 Subject: [PATCH 3/4] Updates --- aspnetcore/blazor/components/quickgrid.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/aspnetcore/blazor/components/quickgrid.md b/aspnetcore/blazor/components/quickgrid.md index 2ebd7121dcf2..9f095a113438 100644 --- a/aspnetcore/blazor/components/quickgrid.md +++ b/aspnetcore/blazor/components/quickgrid.md @@ -72,19 +72,11 @@ To use EF Core as the data source: [!INCLUDE[](~/includes/package-reference.md)] -* Call `AddQuickGridEntityFrameworkAdapter` on the service collection in `Startup.ConfigureServices` of `Startup.cs` (Blazor Server) or `Program.cs` (Blazor WebAssembly) to register an EF-aware implementation of `IAsyncQueryExecutor`. - - * Blazor Server: - - ```csharp - services.AddQuickGridEntityFrameworkAdapter(); - ``` - - * Blazor WebAssembly: - - ```csharp - builder.Services.AddQuickGridEntityFrameworkAdapter(); - ``` +* Call `AddQuickGridEntityFrameworkAdapter` on the service collection in `Program.cs` to register an EF-aware implementation of `IAsyncQueryExecutor`. + + ```csharp + builder.Services.AddQuickGridEntityFrameworkAdapter(); + ``` :::moniker-end From b42af359a7eae233036782ace4a3b5d852ba941c Mon Sep 17 00:00:00 2001 From: guardrex <1622880+guardrex@users.noreply.github.com> Date: Thu, 30 Mar 2023 09:22:06 -0400 Subject: [PATCH 4/4] Updates --- aspnetcore/blazor/components/quickgrid.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/blazor/components/quickgrid.md b/aspnetcore/blazor/components/quickgrid.md index 9f095a113438..7615b321659c 100644 --- a/aspnetcore/blazor/components/quickgrid.md +++ b/aspnetcore/blazor/components/quickgrid.md @@ -66,13 +66,13 @@ For an example that uses an with Entity Framework [!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)] -To use EF Core as the data source: +To use Entity Framework (EF) Core as the data source: * Add a package reference to the app for the [`Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter) package. [!INCLUDE[](~/includes/package-reference.md)] -* Call `AddQuickGridEntityFrameworkAdapter` on the service collection in `Program.cs` to register an EF-aware implementation of `IAsyncQueryExecutor`. +* Call `AddQuickGridEntityFrameworkAdapter` on the service collection in `Program.cs` to register an EF-aware implementation of `IAsyncQueryExecutor`: ```csharp builder.Services.AddQuickGridEntityFrameworkAdapter();