Skip to content

Commit 1f57352

Browse files
authored
Match doc example to Blazor template code (#18149)
1 parent d709a91 commit 1f57352

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

aspnetcore/blazor/get-started/samples_snapshot/3.x/Counter1.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<h1>Counter</h1>
44

5-
<p>Current count: @_currentCount</p>
5+
<p>Current count: @currentCount</p>
66

77
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
88

99
@code {
10-
private int _currentCount = 0;
10+
private int currentCount = 0;
1111

1212
private void IncrementCount()
1313
{
14-
_currentCount++;
14+
currentCount++;
1515
}
1616
}

aspnetcore/blazor/get-started/samples_snapshot/3.x/Counter2.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
<h1>Counter</h1>
44

5-
<p>Current count: @_currentCount</p>
5+
<p>Current count: @currentCount</p>
66

77
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
88

99
@code {
10-
private int _currentCount = 0;
10+
private int currentCount = 0;
1111

1212
[Parameter]
1313
public int IncrementAmount { get; set; } = 1;
1414

1515
private void IncrementCount()
1616
{
17-
_currentCount += IncrementAmount;
17+
currentCount += IncrementAmount;
1818
}
1919
}

0 commit comments

Comments
 (0)