I understand that a good way to check if an user is in a role is:
if (User.IsInRole(\"Admin\")) { }
However How can I check if my user is
Please, use this simple way :
@using Microsoft.AspNet.Identity @if (Request.IsAuthenticated) { if (User.IsInRole("Administrator") || User.IsInRole("Moderator")) { ... Your code here } }