Raven.AspNetProviders.RavenRoleProvider.FindUsersInRole C# (CSharp) Method

FindUsersInRole() public method

public FindUsersInRole ( string roleName, string usernameToMatch ) : string[]
roleName string
usernameToMatch string
return string[]
        public override string[] FindUsersInRole(string roleName, string usernameToMatch)
        {
            using (var session = _documentStore.OpenSession())
            {
                var users = session.Query<User, Users_ByApplicationNameAndUsername>()
                    .Where(x => x.ApplicationName == ApplicationName && x.Roles.Contains(roleName))
                    .Search(x => x.Username, usernameToMatch)
                    .Select(x => x.Username);

                return users.ToArray();
            }
        }