# Exists2

Testa se pelo menos um par de elementos na mesma posição nas duas coleções satisfaz a condição definida por `predicate`.

Esta função é interrompida assim que encontrar o primeiro par de elementos que satisfaça a condição informada.

> &#x20;**Atenção**&#x20;
>
> Este método causa a avaliação do [`IEnumerable<T>`](https://msdn.microsoft.com/pt-br/library/9eekhta0%28v=vs.110%29.aspx).

| Parâmetros                                                                                     | Retorno |
| ---------------------------------------------------------------------------------------------- | ------- |
| <p>Func\<T, T, bool> predicate</p><p>IEnumerable\<T> source1</p><p>IEnumerable\<T> source2</p> | bool    |

## Como usar

&#x20;**Verificando a existência de um valor par e outro ímpar em duas coleções**&#x20;

```csharp
//IEnumerable<int> first = { 1, 3, 5, 7, 9, 9, 2 }
//IEnumerable<int> second = {1, 3, 1, 9, 2, 3, 5 }

bool result = first.Exists2(
        second,
        (value1, value2) =>    value1 % 2 == 0 
                            && value2 % 2 == 1);

//result = true when 2 && 5
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gabriel-schade-cardoso.gitbook.io/tango-br/modulos/collection/exists2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
