# CachedMessageBlock.TryFindFirstMessage(StreamId, ICacheDataAdapter, int)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessageblock/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessageblock/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Common/PooledCache/CachedMessageBlock.cs#L192)

```csharp
public bool TryFindFirstMessage(StreamId streamId, ICacheDataAdapter dataAdapter, out int index)
```

Tries to find the first message in the block that is part of the provided stream.

### Parameters

- `streamId` (`StreamId`): The stream identifier.
- `dataAdapter` (`ICacheDataAdapter`): The data adapter.
- `index` (`int`): The index.

### Returns

`true` if the message was found, `false` otherwise.
