title: Managing Roles In ASP MVC 3 Code First Approach
body: <p>I am developing an ASP .Net MVC 3 application using C# and SQL Server 2005.</p>
  
  <p>I am using also Entity Framework and Code First Method.</p>
  
  <p>I have an interface Login that works perfectly.</p>
  
  <p>My problem that I have 3 Types of Users : </p>
  
  <ul>
  <li>Root</li>
  <li>Admin</li>
  <li>User</li>
  </ul>
  
  <p>and each one has a custom access to the pages of the application.</p>
  
  <p>I search on the net and I found many tutos describing how to manage Roles but all are not using a database or using an existing database with ADO .NET, database first</p>
  
  <p>My problem that I am using ENTITY <strong>FRAMEWORK</strong> and <strong>CODE FIRST</strong>.</p>
  
  <p><img src="https://i.stack.imgur.com/NMamN.jpg" alt="tables"></p>
  
  <p>This is what I have in my base . How can I bind this tables with my code ? I already used <code>[Authorize]</code> in some action and its works perfectly  but now how I use <code>[Authorize (Roles="Admin")]</code> with my database.</p>