BlogEngine.Core.Providers.XmlRoleProvider.RoleExists C# (CSharp) Method

RoleExists() public method

Gets a value indicating whether the specified role name already exists in the role data source for the configured applicationName.
public RoleExists ( string roleName ) : bool
roleName string /// The name of the role to search for in the data source. ///
return bool
        public override bool RoleExists(string roleName)
        {
            if (Utils.StringIsNullOrWhitespace(roleName))
            {
                throw new ArgumentNullException("roleName");
            }
            else
            {
                // Role names are not supposed to be case sensitive. This needs to be kept consistent with
                // other RoleProvider classes.

                return (this.GetAllRoles().Contains(roleName, StringComparer.OrdinalIgnoreCase));
            }
        }