Skip to content

Commit 3581710

Browse files
authored
Fix Blazor code examples (#18466)
1 parent 9c1f96a commit 3581710

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

aspnetcore/blazor/call-web-api.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to call a web API from a Blazor WebAssembly app using JSO
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 05/19/2020
8+
ms.date: 05/24/2020
99
no-loc: [Blazor, "Identity", "Let's Encrypt", Razor, SignalR]
1010
uid: blazor/call-web-api
1111
---
@@ -133,9 +133,7 @@ JSON helper methods send requests to a URI (a web API in the following examples)
133133
134134
private void EditItem(long id)
135135
{
136-
var editItem = todoItems.Single(i => i.Id == id);
137-
editItem = new TodoItem { Id = editItem.Id, Name = editItem.Name,
138-
IsComplete = editItem.IsComplete };
136+
editItem = todoItems.Single(i => i.Id == id);
139137
}
140138
141139
private async Task SaveItem() =>

aspnetcore/blazor/common/samples/3.x/BlazorWebAssemblySample/Pages/CallWebAPI.razor

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ else
9191

9292
private void EditItem(long id)
9393
{
94-
var editItem = todoItems.Single(i => i.Id == id);
95-
editItem = new TodoItem { Id = editItem.Id, Name = editItem.Name, IsComplete = editItem.IsComplete };
94+
editItem = todoItems.Single(i => i.Id == id);
9695
editRowStyle = "table-row";
9796
}
9897

0 commit comments

Comments
 (0)