Remove all Roles from a user MVC 5
<p>Peace be upon you</p>

<p>I am trying to remove all roles from a user to disable his permissions and prevent him from accessing some pages.</p>

<p>I found this method to remove one role and it worked:</p>

<pre><code>await UserManager.RemoveFromRoleAsync(userid, role);
</code></pre>

<p>Where userid is the user ID that I want to disable his permission. </p>

<p>So, I use this code to delete all roles from the same user</p>

<pre><code>foreach (string role in roles) {

 await UserManager.RemoveFromRoleAsync(userid, role);

}
</code></pre>

<p>But I stuck here how to save roles Id which are in AspNetRoles table to</p>

<pre><code>string[] roles 
</code></pre>

<p>Any help?</p>

<p>or is there another way to delete all roles from a user? </p>

<p>I am using asp.net identity version 2</p>