# AsyncEnumerableExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.asyncenumerableextensions/)

## WithBatchSize(IAsyncEnumerable&lt;T&gt;, int) {#withbatchsize-1-this-system-collections-generic-iasyncenumerable-t-int-a055ef1a}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.asyncenumerableextensions/methods/withbatchsize-1-this-system-collections-generic-iasyncenumerable-t-int-a055ef1a/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Runtime/AsyncEnumerableRequest.cs#L414-L420)

```csharp
public static IAsyncEnumerable<T> WithBatchSize<T>(this IAsyncEnumerable<T> self, int maxBatchSize)
```

Specifies the maximum batch size for an `System.Collections.Generic.IAsyncEnumerable-1` request.

### Parameters

- `self` (`IAsyncEnumerable<T>`): The instance to configure.
- `maxBatchSize` (`int`): The batch size.

### Returns

The original instance.
