From 87078447d37fcf5f7cc2be954d0184acd86a7f2e Mon Sep 17 00:00:00 2001 From: Paul Welter Date: Tue, 30 Jul 2024 16:30:48 -0500 Subject: [PATCH] make CreateDataRequest public --- src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs | 5 ++--- src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs b/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs index 21d59e8..5c12a43 100644 --- a/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs +++ b/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs @@ -168,10 +168,9 @@ protected virtual async ValueTask RefreshCoreAsync() } - protected virtual DataRequest CreateDataRequest(CancellationToken cancellationToken) + public virtual DataRequest CreateDataRequest(CancellationToken cancellationToken = default) { - var request = new DataRequest(Pager.Page, Pager.PageSize, null, null, cancellationToken); - return request; + return new DataRequest(Pager.Page, Pager.PageSize, null, null, cancellationToken); } // used when Data is set directly diff --git a/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs b/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs index db856aa..bb793d5 100644 --- a/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs +++ b/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs @@ -242,7 +242,7 @@ internal void AddColumn(DataColumn column) } - protected override DataRequest CreateDataRequest(CancellationToken cancellationToken) + public override DataRequest CreateDataRequest(CancellationToken cancellationToken = default) { var sorts = Columns .Where(c => c.CurrentSortIndex >= 0)