title: User.IsInRole not working. How to check rolebased authorization?
body: <p>I am using MVC 5 with EntityFramework 6. In "IdentityModel" I am inheriting IdentityUser class using following code:</p>
  
  <pre><code>public class ApplicationUser : IdentityUser
  {
      [Display(Name="First Name")]
      [StringLength(50, ErrorMessage = "Length exceed")]
      public string FirstName { set; get; }
  
      [Display(Name = "Last Name")]
      [StringLength(50, ErrorMessage = "Length exceed")]
      public string LastName { set; get; }
  
  }
  public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
  {
      public ApplicationDbContext()
          : base("DefaultConnection")
      {
          this.Configuration.LazyLoadingEnabled = false;
      }
  
  
    protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
  
  
  
          modelBuilder.Entity&lt;IdentityUser&gt;().HasKey(r =&gt; r.Id); 
          modelBuilder.Entity&lt;IdentityUserLogin&gt;().HasKey&lt;string&gt;(l =&gt; l.UserId);
          modelBuilder.Entity&lt;IdentityRole&gt;().HasKey&lt;string&gt;(r =&gt; r.Id);
          modelBuilder.Entity&lt;IdentityUserRole&gt;().HasKey(r =&gt; new { r.RoleId, r.UserId });
  
  
      }
  </code></pre>
  
  <p>I have assigned roles to "IdentityUser" using the following code:</p>
  
  <pre><code>UserManager.AddToRole(user.Id, "User");
  </code></pre>
  
  <p>I can see assigned roles in "IdentityUserRole" table, but when trying to access the roles using </p>
  
  <pre><code>User.IsInRole("User");
  </code></pre>
  
  <p>It returns always false.</p>
  
  <p>After adding following code in my web.config I get "Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'." this error.</p>
  
  <pre><code>&lt;roleManager enabled="true" defaultProvider="SqlRoleProvider"&gt;
    &lt;providers&gt;
      &lt;clear/&gt; 
      &lt;add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="DefaultConnection"  /&gt;
    &lt;/providers&gt;
  &lt;/roleManager&gt;
  </code></pre>
  
  <p>I am not using code first migration.</p>