Affecto.IdentityManagement.Store.EntityFramework.Queries.RoleExistsQuery.Execute C# (CSharp) Method

Execute() public method

public Execute ( string name ) : bool
name string
return bool
        public bool Execute(string name)
        {
            name = name.ToLower();
            return roles.Any(o => o.Name.ToLower() == name);
        }

Usage Example

        public bool RoleExists(string name)
        {
            var query = new RoleExistsQuery(dbContext.Roles);

            return query.Execute(name);
        }