I am building a prediction website on ASP.NET core in Visual Studio and of course I need a "score" variable for each user. That's why I added a "score" column to the built-in IdentityUser table by creating a new class with IdentityUser as base class. The only thing I added there is a property called Score.
public class UserIdentity : IdentityUser<Guid>
{
public int Score { get; set; }
}
Now I want to display the score in the navbar along with the username of the current user, but I get the error that Score does not exist in the same namespace as the username.
HTML code from my _Layout file (for the navigation bar):
@if (signInManager.IsSignedIn(User))
{
<li class="nav-item">
<form method="post" asp-action="logout" asp-controller="account">
<button type="submit" class="nav-link btn btn-link py-0" style="width:auto">Uitloggen @User.Identity.Name <br /> @Convert.ToString(User.Identity.Score) punten</button>
</form>
</li>
}
Thanks in advance!