Convert query to array with ToArray