Skip to content

Commit

Permalink
UserAdmin model
Browse files Browse the repository at this point in the history
  • Loading branch information
ArttuKuikka committed Oct 4, 2024
1 parent 211d1ec commit 6ddb54c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Controllers/UserAdminController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public UserAdminController(ApplicationDbContext db, SignInManager<IdentityUser>

public IActionResult Index()
{
ViewBag.users = _userManager.Users.ToList();
return View();
var model = new List<IdentityUser>();
model = _userManager.Users.ToList();
return View(model);
}

public async Task<IActionResult> PoistaKayttaja(string id)
Expand Down
5 changes: 3 additions & 2 deletions Views/UserAdmin/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using Microsoft.AspNetCore.Identity
@model List<Microsoft.AspNetCore.Identity.IdentityUser>
@using Microsoft.AspNetCore.Identity
@{
ViewData["Title"] = "Hallinta";
}
Expand All @@ -14,7 +15,7 @@
</tr>
</thead>
<tbody>
@foreach (IdentityUser kayttaja in ViewBag.users)
@foreach (IdentityUser kayttaja in Model)
{
<tr>
<td style="color: white">@kayttaja.Email</td>
Expand Down

0 comments on commit 6ddb54c

Please sign in to comment.