From 626a154a3a7332a9a21b15df654ec5b138266dd2 Mon Sep 17 00:00:00 2001
From: Ivan Josipovic <9521987+IvanJosipovic@users.noreply.github.com>
Date: Wed, 3 Jun 2020 21:20:39 -0700
Subject: [PATCH] Fix Bug #135 (#137) #patch
Fix Bug #135
NuGet update
---
src/BlazorTable.Sample.Shared/Bugs/135.razor | 33 +++++++++++++++++++
.../BlazorTable.Tests.csproj | 4 +--
src/BlazorTable/Components/Table.razor.cs | 2 +-
3 files changed, 36 insertions(+), 3 deletions(-)
create mode 100644 src/BlazorTable.Sample.Shared/Bugs/135.razor
diff --git a/src/BlazorTable.Sample.Shared/Bugs/135.razor b/src/BlazorTable.Sample.Shared/Bugs/135.razor
new file mode 100644
index 00000000..9087a72a
--- /dev/null
+++ b/src/BlazorTable.Sample.Shared/Bugs/135.razor
@@ -0,0 +1,33 @@
+@page "/135"
+
+@using BlazorTable
+
+
+
+@code
+{
+ private PersonData[] data;
+
+ protected override async Task OnInitializedAsync()
+ {
+ data = new PersonData[]
+ {
+ new PersonData()
+ {
+ ShortId = 5
+ }
+ };
+ }
+
+ public class PersonData
+ {
+ public int ShortId { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/BlazorTable.Tests/BlazorTable.Tests.csproj b/src/BlazorTable.Tests/BlazorTable.Tests.csproj
index 07f7eeb1..c24e25f3 100644
--- a/src/BlazorTable.Tests/BlazorTable.Tests.csproj
+++ b/src/BlazorTable.Tests/BlazorTable.Tests.csproj
@@ -12,11 +12,11 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/BlazorTable/Components/Table.razor.cs b/src/BlazorTable/Components/Table.razor.cs
index 235b505c..43e2cf03 100644
--- a/src/BlazorTable/Components/Table.razor.cs
+++ b/src/BlazorTable/Components/Table.razor.cs
@@ -423,7 +423,7 @@ private Expression> GlobalSearchQuery(string value)
{
Expression> tmp = null;
- foreach (var column in Columns)
+ foreach (var column in Columns.Where(x => x.Field != null))
{
var newQuery = Expression.Lambda>(
Expression.AndAlso(