Ejemplo n.º 1
0
 // Inherited from RoleProvider ==> Forwarded to previous provider if this provider hasn't been initialized
 public override bool RoleExists(string roleName)
 {
     if (!InitializeCalled)
     {
         return(PreviousProvider.RoleExists(roleName));
     }
     using (var db = ConnectToDatabase()) {
         return(FindRoleId(db, roleName) != -1);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets a value indicating whether the specified role name already exists in the role data source for the configured applicationName.
 /// </summary>
 /// <remarks>Inherited from RoleProvider ==> Forwarded to previous provider if this provider hasn't been initialized</remarks>
 /// <param name="roleName">The name of the role to search for in the data source.</param>
 /// <returns>true if the role name already exists in the data source for the configured applicationName; otherwise, false.</returns>
 public override bool RoleExists(string roleName)
 {
     if (!InitializeCalled)
     {
         return(PreviousProvider.RoleExists(roleName));
     }
     using (var db = NewMySqlSecurityDbContext)
     {
         return(FindRoleId(db, roleName) != -1);
     }
 }