Skip to content

Commit

Permalink
renamed Delete to DeleteItem (action didn't work for Delete for some …
Browse files Browse the repository at this point in the history
…reason)
  • Loading branch information
aremo-ms committed Aug 25, 2022
1 parent 49476ae commit 0f7e06b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task<ActionResult> Edit(int id, [Bind("Id,Title,Owner")] Todo todo)
}

// GET: TodoList/Delete/5
public async Task<ActionResult> Delete(int id)
public async Task<ActionResult> DeleteItem(int id)
{
Todo todo = await this._todoListService.GetAsync(id);

Expand All @@ -82,7 +82,7 @@ public async Task<ActionResult> Delete(int id)
// POST: TodoList/Delete/5
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Delete(int id, [Bind("Id,Title,Owner")] Todo todo)
public async Task<ActionResult> DeleteItem(int id, [Bind("Id,Title,Owner")] Todo todo)
{
await _todoListService.DeleteAsync(id);
return RedirectToAction("Index");
Expand Down
4 changes: 2 additions & 2 deletions 4-WebApp-your-API/4-1-MyOrg/Client/TodoListClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Web" Version="1.25.1" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="1.25.1" />
<PackageReference Include="Microsoft.Identity.Web" Version="1.25.2" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="1.25.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</dd>
</dl>

<form asp-action="Delete">
<form asp-action="DeleteItem">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
@Html.ActionLink("Details", "Details", new { id = item.Id }) |
@Html.ActionLink("Delete", "Delete", new { id = item.Id })
@Html.ActionLink("Delete", "DeleteItem", new { id = item.Id })
</td>
</tr>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Web" Version="1.25.1" />
<PackageReference Include="Microsoft.Identity.Web" Version="1.25.2" />
</ItemGroup>

</Project>

0 comments on commit 0f7e06b

Please sign in to comment.