Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

MudBlazor DataGrid loads entire database when used with Entity Framework

$
0
0

I'm using a MudBlazor DataGrid to display records from SQL Server, which I am accessing via Entity Framework. The table I'm querying might contain anywhere from several thousand to several million rows.

On small test data sets, the DataGrid performs just fine, however when I connect it to production-scale test data, the performance becomes extremely slow, taking roughly the same time a SELECT * FROM MyTable takes on SQL Server to load or change pages. The UI on the client side also becomes terribly slow (which suggests to me that the server may be transmitting a lot of data to the client and using up lots of memory).

My DataGrid looks as follows:

<MudDataGrid Items="MyContext.MyTable"             FixedHeader="true" FixedFooter="true" Hover="true"             SortMode="SortMode.Single" Filterable="true"             FilterMode="DataGridFilterMode.ColumnFilterMenu"             RowClick="NavigateToWork" T="IMyRecord" Hideable="true"             FilterCaseSensitivity="DataGridFilterCaseSensitivity.CaseInsensitive"             DragDropColumnReordering="true" ColumnsPanelReordering="true"             ColumnResizeMode="ResizeMode.Column"             ShowMenuIcon="true"><Columns><PropertyColumn Property="@(x => x.Id)" />        @* etc *@</Columns><PagerContent><MudDataGridPager T="IMyRecord" /></PagerContent></MudDataGrid>

Is there something I'm missing to specify that it shouldn't load the whole table, or does the DataGrid internally use AsEnumerable or ToList on the IQueryable I pass to it and force the download somewhere beyond my control?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>