@using Microsoft.AspNetCore.Identity
@using Microsoft.AspNetCore.Http

@inject SignInManager<IdentityUser> SignInManager
@inject UserManager<IdentityUser> UserManager
@inject IHttpContextAccessor HttpContextAccessor


<ul class="navbar-nav">
    @if (HttpContextAccessor.HttpContext.Session.GetInt32("IdUtilisateur") != null)
    {
        <li class="nav-item navbar-nav flex-grow-1">
            <form asp-controller="Compte" asp-action="Logout" method="post" class="form-inline">
                <button type="submit" class="nav-link btn btn-link text-dark">Se déconnecter</button>
            </form>
        </li>
    }
    else
    {
        <li class="nav-item">
            <a class="nav-link text-dark" asp-controller="Compte" asp-action="Register">Creer un compte</a>
        </li>
        <li class="nav-item">
            <a class="nav-link text-dark" asp-controller="Compte" asp-action="Login">Se connecter</a>
        </li>
    }
</ul>
