diff --git a/src/MudBlazor/Components/DataGrid/FooterContext.cs b/src/MudBlazor/Components/DataGrid/FooterContext.cs index 7099d67d1cb2..2bbf2b723acc 100644 --- a/src/MudBlazor/Components/DataGrid/FooterContext.cs +++ b/src/MudBlazor/Components/DataGrid/FooterContext.cs @@ -28,14 +28,14 @@ public bool? IsAllSelected { get { - - if (_dataGrid.Selection != null && (Items?.Any() ?? false)) + if (_dataGrid.Selection is not null && (Items?.Any() ?? false)) { if (_dataGrid.Selection.Count == Items.Count()) { return true; } - else if (_dataGrid.Selection.Count == 0) + + if (_dataGrid.Selection.Count == 0) { return false; } diff --git a/src/MudBlazor/Components/DataGrid/HeaderContext.cs b/src/MudBlazor/Components/DataGrid/HeaderContext.cs index e53cac186cee..2b0fd03b98d6 100644 --- a/src/MudBlazor/Components/DataGrid/HeaderContext.cs +++ b/src/MudBlazor/Components/DataGrid/HeaderContext.cs @@ -28,14 +28,14 @@ public bool? IsAllSelected { get { - - if (_dataGrid.Selection != null && (Items?.Any() ?? false)) + if (_dataGrid.Selection is not null && (Items?.Any() ?? false)) { if (_dataGrid.Selection.Count == Items.Count()) { return true; } - else if (_dataGrid.Selection.Count == 0) + + if (_dataGrid.Selection.Count == 0) { return false; } @@ -59,7 +59,7 @@ public HeaderContext(MudDataGrid dataGrid) public class HeaderActions { - public Func SetSelectAllAsync { get; init; } = null!; + public required Func SetSelectAllAsync { get; init; } } } }