Skip to content

Commit 2edcf3b

Browse files
authored
[Blazor] Ensure FirstName and LastName Follow Pascal Case in QuickGrid Component (#60340)
Fixes #60325
1 parent b1b97f2 commit 2edcf3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Components/test/testassets/BasicTestApp/QuickGridTest/SampleQuickGridComponent.razor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55
<div id="grid">
66
<QuickGrid @ref="@quickGridRef" Items="@FilteredPeople" Pagination="@pagination" RowClass="HighlightJulie" custom-attrib="somevalue" class="custom-class-attrib">
77
<PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
8-
<PropertyColumn Property="@(p => p.firstName)" Sortable="true">
8+
<PropertyColumn Property="@(p => p.FirstName)" Sortable="true">
99
<ColumnOptions>
1010
<div class="search-box">
1111
<input type="search" autofocus @bind="firstNameFilter" @bind:event="oninput" placeholder="First name..." />
1212
</div>
1313
<button type="button" id="close-column-options" @onclick="@(() => quickGridRef.CloseColumnOptionsAsync())">Close Column Options</button>
1414
</ColumnOptions>
1515
</PropertyColumn>
16-
<PropertyColumn Property="@(p => p.lastName)" Sortable="true" />
16+
<PropertyColumn Property="@(p => p.LastName)" Sortable="true" />
1717
<PropertyColumn Property="@(p => p.BirthDate)" Format="yyyy-MM-dd" Sortable="true" />
1818
<PropertyColumn Title="Age in years" Property="@(p => ComputeAge(p.BirthDate))" Sortable="true"/>
1919
</QuickGrid>
2020
</div>
2121
<Paginator State="@pagination" />
2222

2323
@code {
24-
record Person(int PersonId, string firstName, string lastName, DateOnly BirthDate);
24+
record Person(int PersonId, string FirstName, string LastName, DateOnly BirthDate);
2525
PaginationState pagination = new PaginationState { ItemsPerPage = 10 };
2626
string firstNameFilter;
2727
QuickGrid<Person> quickGridRef;
2828

2929
int ComputeAge(DateOnly birthDate)
3030
=> DateTime.Now.Year - birthDate.Year - (birthDate.DayOfYear < DateTime.Now.DayOfYear ? 0 : 1);
3131

32-
string HighlightJulie(Person person) => person.firstName == "Julie" ? "highlight" : null;
32+
string HighlightJulie(Person person) => person.FirstName == "Julie" ? "highlight" : null;
3333

3434
IQueryable<Person> FilteredPeople
3535
{
@@ -39,7 +39,7 @@
3939

4040
if (!string.IsNullOrEmpty(firstNameFilter))
4141
{
42-
result = result.Where(p => p.firstName.Contains(firstNameFilter, StringComparison.CurrentCultureIgnoreCase));
42+
result = result.Where(p => p.FirstName.Contains(firstNameFilter, StringComparison.CurrentCultureIgnoreCase));
4343
}
4444

4545
return result;

0 commit comments

Comments
 (0)