1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Suppress warnings

This commit is contained in:
asesidaa 2022-09-16 21:48:16 +08:00
parent 59b8684717
commit f8abca64b5

View File

@ -27,8 +27,15 @@
</MudTh>
</HeaderContent>
<RowTemplate>
@{
// Disable nullable warnings, which seems to be a false positive
# pragma warning disable CS8602
}
<MudTd DataLabel="Id" Class="cursor-pointer">@context.TitleId</MudTd>
<MudTd DataLabel="Title" Class="cursor-pointer">@context.TitleName</MudTd>
@{
#pragma warning restore CS8602
}
</RowTemplate>
<PagerContent>
<MudTablePager/>
@ -74,8 +81,12 @@
}
}
private bool Filter(Title title)
private bool Filter(Title? title)
{
if (title is null)
{
return false;
}
return string.IsNullOrEmpty(searchString) ||
title.TitleName.Contains(searchString, StringComparison.InvariantCultureIgnoreCase);
}